Parameter | Details |
---|---|
parametersMapExpression | The Map with parameters. Not required |
subreportParameter | The pair of name and value (set with subreportParameterExpression). Not required. Several parameters can be passed to subreport |
connectionExpression | Connection for getting data. Not required |
dataSourceExpression | Expression for passing Datasource. Not required |
subreportExpression | The subreport's path/URI or even JasperReport object. Not required |
returnValue | The pair of name and value. Not required. Several values can be returned from subreport to master report back |
Subreports can be used for constructing complex reports. The reusing of existing reports is another goal of using subreports.
The subreport will be shown as a part of master report in case using of <subreport>
element.
The value of subreportExpression parameter is differ for using at JasperReports Server or just by JasperReports framework (some API using or using in IDE).
For JasperReports Server it looks like:
<subreportExpression><![CDATA["repo:subreport.jrxml"]]></subreportExpression>
For using by just JasperReports engine:
<subreportExpression><![CDATA["/somePath/subreport.jasper"]]></subreportExpression>
The great explanation by @AndreasDietrich can be found at JasperServer: Unable to locate the subreport exception post
For some reasons the subreport can be used as a common report - without calling from the master report (with help of <subreport>
element). The subreport is always a report.