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

Subreport not filled with XML data source and compilation at runtime


ruffp
Go to solution Solved by ruffp,

Recommended Posts

My case is really simple: 

The idea is to have this:

  1. Each reports and subreport are in my WEB-INF java we app (WAR) in a jrxml form only
  2. 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
  3. 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

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

  • Solution

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

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