Jump to content
Changes to the Jaspersoft community edition download ×

XPath not finding datasource except from iReport


justis

Recommended Posts

Something is different between my iReport environment and my hand coded Java tester, but I can't figure out what it is. I'm doing some very simple XPath as a proof of concept and my sample data file only has 3 rows of data. They display fine when it gets filled from iReport 2.0.2, but it only has one line (and all the values are "null") when I run it from the following Java code:

Code:

 

Of particular interest, note that it's resolving the logo and title, which are also retrieved by XPath. It seems to only be missing the data from "report-data/row".

 

Here's a ZIP file with the JRXML and the XML data: [file name=xpath_to_nowhere.zip size=1989]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/xpath_to_nowhere.zip[/file]

 

Does anyone have suggestions?

 

Kind regards,

Justis

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

I also noticed that iReport was using a different query executor factory than I was, so I tried that. Still the same results, with either one of these as the factory:

Code:
JRProperties.setProperty("net.sf.jasperreports.query.executer.factory.xpath2", "com.jaspersoft.jrx.query.JRXPathQueryExecuterFactory"«»);
JRProperties.setProperty("net.sf.jasperreports.query.executer.factory.xpath2", "net.sf.jasperreports.engine.query.JRXPathQueryExecuterFactory"«»);

Kind regards,

Justis

Link to comment
Share on other sites

I found the solution elsewhere on the forums:

http://www.jasperforge.org/index.php?option=com_joomlaboard&Itemid=215&func=view&catid=8&id=28811

 

 

It turns out that the problem was that I was passing it a JRXmlDataSource when filling the report, when I should have been passing the XML as a org.w3c.dom.Document into the parameters map.

 

Thanks to Lucian for answering it clearly in the other thread.

 

Kind regards,

Justis

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...