I'm trying to generate a report from java code with jasper-reports (without iReport).
Have successfully created the following elements:
- Master report object (class: JasperDesign) named reportDesign
- Sub report object (class: JasperDesign) named subReportDesign
- SubReport element (class: JRDesignSubreport) in the Master report named subReportElement
- Compiled Sub report (class: JasperDesign) named subReport
The problem is, how do I reference the subReportDesign object from the subReportElement?
So far the only way I found, was to set subReportElement's "expression" field to $P{REPORT_PARAMETERS_MAP}.get("subreportobject")
, and to put subReport into reportDesign during the compilation.
Is there another way? For example can I use variables - in some way .. - before compiling the Master report?
thanks, krisy