ruffp Posted January 25, 2013 Share Posted January 25, 2013 My case is really simple: The idea is to have this: Each reports and subreport are in my WEB-INF java we app (WAR) in a jrxml form only I followed this method to refer the subreport from the master and using the compilation at runtime http://stackoverflow.com/questions/9785451/generate-jasper-report-with-subreport-from-java I have a single XML file used as datasource for all the reports (master + all subreports)The problem is that when I compile the sub-reports at runtime (even it is made only once) the sub report have no data. I tried different ways to pass the data: - XML_DATA_DOCUMENT (using the demo/samples/xmldatasource from the distrib) and - REPORT_DATA_SOURCE: ((net.sf.jasperreports.engine.data.JRXmlDataSource)$P{REPORT_DATA_SOURCE}).subDataSource("/parameters/selected/item[category=Offers]") but none is working. The question is : when we compile the subreport, should we provide the data to the master beforeor after we pass the compiled subreports ? The only workaround I have is to compile all and use the hardcoded exprfession "subreport_x.jasper" in the master report to refers them. Link to comment Share on other sites More sharing options...
Solution ruffp Posted January 28, 2013 Author Solution Share Posted January 28, 2013 I found the solution... it was misspelled sub-report parameters.The filling with the XML_DATA_DOCUMENT way it works very well.Note that It tried to delete this question as it was simply an error from my side, but did not find the way how to do it. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now