Use case
It is sometimes convenient to use existing Ad Hoc reports as subreports for reports created in Jaspersoft Studio.
Solution
Starting from JasperReports Server v6.2.1 it is possible to use Ad Hoc reports as subreports by leveraging the com.jaspersoft.jrs.data.source property and pointig it to an Ad Hoc View correspondent to the Ad Hoc report. This property needs to be configured in the subreport JRXML, not in JRXML of the main report:
Attached is a working example (it will be imported into /Public folder) here's how it can be replicated:
- create an Adhoc view and a report
- copy the report JRXML and set the com.jaspersoft.jrs.data.source property to the path of the Adhoc view
- for table reports, you currently need to explicitly pass true for a parameter called _AdHocTableFlattenedDS
Note that Adhoc charts currently grow to render on the whole page in the viewer, if the master report page has other elements the chart will likely ruin the layout.
----------------------
Ref case #01450923
Recommended Comments
There are no comments to display.
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