Jump to content
We've recently updated our Privacy Statement, available here ×

Report Compilation Problem with xpath2 usage.


raja_s_patil

Recommended Posts

Hi,

I am using ireport to create Report Templates and PHP-Java-Bridge to

compile it through PHP. iReport ver. is 3.5.2, JDK 6, tomcat 6.0, WAMP server.

I have succesfully tested master-detail report using local XML data file with

xpath2 queries for master and detail in ireport and its giving desired results.

However when I am trying to compile reports with PHP following error is thrown

 

net.sf.jasperreports.engine.JRRuntimeException:

net.sf.jasperreports.engine.JRException:

No query executer factory class registered for xpath2 queries.

 

When I change query language to xpath it compiles fine in both iReport and PHP

but the results are not as expected in both environments which is natural since it

needs xpath2 features.

Can somebody guide in this situation ?  (The matter is bit urgent)

My best guess to this problem is that i might have missed some .jars while

copying from jasperreports 3.5.2. If it is so then please tell me which jar is required for

using xpath2. Another guess is iReport uses some other compilation jars than what

jasper reports uses but I feel its a remote probability.

 

Thanks and best regards.

Raja.

Link to comment
Share on other sites

  • Replies 6
  • Created
  • Last Reply

Top Posters In This Topic

Hi,

 

I think you first need to understand what the language attribute of the <queryString> tag is for, in JRXML.

It specifies the name of a query language that JasperReports understands because it has a query executer factory already associated with it.

When you download JR or iR, they already have query executer implementation associated with a language called "xpath".

But they do not have any query executer implementation associated with "xpath2", just like they dont have one for a query language called "raja".

 

If you want JasperReports to be able to understand a query language, you need to write a query executer for that language, if it does not already exists. I'm not an expert on XPath, but it might be that you don't have to use a new XPath query executer in order to use XPath 2 queries. The one already existing in JR might work for XPath 2 queries as well. So the first thing to try is to keep the language name as "xpath", regardless whether you actually write XPath 2 queries.

If it does not work, the you might need to write an XPath 2 capable query executer and register it with a query language that you invent a name for. This might very well be "xpath2". but you are free to pick whatever name you want for it, as long as you make the appropriate mappings in the jasperreports.proeprties file. Look at the default.jasperreports.properties files inside the JR JAR to see which are the default query executers that JR has and how you could create and add one of your own.

 

I hope this helps.
Teodor

 

Link to comment
Share on other sites

Thanks,

I am designing reports using iReport and in that there are two different query language options

xpath and xpath2. I got confused because when I use xpath2 the report gets compiled and

executes well in iReport. iReport uses jasperReport as base so i felt that I might be missing

something to get it compiled in PHP with jasperReports. However if I compile template in iReport and

execute it in jasperReport with xpath2 it works fine. So only compilation is affected in jasperReports

with xpath2 query language. Can u take a look at it why only compilation is affected when template

is created with iReport ? as of today jasperReports works fine with iReport pre-compiled templates.

However I will try same report with xpath as query language in more detail and let u know exactly

what is hapenning

 

Thanks and best regards.

 

Raja.

Link to comment
Share on other sites

 

Hi Raja,

xpath2 requires a special query executer that is not part of the standard JasperReports distribution. It is part of Jasperreports-extensions project, a special project where we commit all the features that are not part of the JasperReports main distribution.

The project is:

http://jasperforge.org/projects/jasperreportsextensions

The jar you need to put in your classpath is called jasperreports-extensions-3.5.3 and it is part of the jasperreports-extensions module of iReport.

Giulio

Link to comment
Share on other sites

Thanks Teodor,

 

I posted this question in ireport forum first and waited for two days

then I thought This might be in perview of JasperReports so I posted it

here also. Sorry for inconvennience. Any how giulio has responded here

the solution.

 

Thanks once again and best regards

 

Raja

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...