XPath and subDataSource expressions

 hey All,

I am using a subreport to generate additional data for a report.

My subreport generates a graph and calls up additional sub-reports to create additional tables.

Here are my options I tested:

1) ((net.sf.jasperreports.engine.data.JRXmlDataSource)$P{REPORT_DATA_SOURCE}).subDataSource("//page[@pageno=7 or @pageno=6]")

2) ((net.sf.jasperreports.engine.data.JRXmlDataSource)$P{REPORT_DATA_SOURCE}).subDataSource("//page[@pageno=7]")

3) ((net.sf.jasperreports.engine.data.JRXmlDataSource)$P{REPORT_DATA_SOURCE}).subDataSource("//page[@pageno=6]")

4) ((net.sf.jasperreports.engine.data.JRXmlDataSource)$P{REPORT_DATA_SOURCE}).subDataSource("//page[@pageno=6] | //page[@pageno=7]")

5) ((net.sf.jasperreports.engine.data.JRXmlDataSource)$P{REPORT_DATA_SOURCE}).subDataSource("//page")


1) Does print my table, but my graph is empty
2) Does print my table, but my graph is empty
3) Does print my graph, but table is empty
4) Does print my table, but my graph is empty
5) Doesn't print graph or table data
- The graph xpath expressions have been tested with full and partial XML data, so even when page7 is included, the data get's generated.
- All xpath expressions have been tested in xpanther under firefox, I know not a authority on xpath correctness, but all expressions have been looked up against specifications.
- No errors during report generation.
I honestly don't understand why I cannot pass a sub data source consist of my two pages, afterall.. it's just XML, right?
How would debug this problem? Usually I would step through code and find the problem, but iReport doesn't seem to have this capability using debuggers, or any way to output more sensible data, can it do that?
My main problem now is, how to debug instead of trial and error changing things around?
Ladtly, if I cannot figure it out. Anybody know a good company who can? (Against a normal hourly rate....)
riesvantwisk's picture
Joined: Feb 21 2008 - 8:09am
Last seen: 6 years 5 months ago

1 Answer:

I'd recommend trying to get help from the people at JasperSoft themselves. They especially enjoy technically challenging problems.
thangalin's picture
Joined: Apr 21 2008 - 4:34am
Last seen: 3 years 5 months ago