When defining subreports that use a domain datasource within iReport, there are a few parameters that must be defined to pass the appropriate connection details to the subreport. Parameters to add to main report and subreport filesIn main report and every subreport JRXML file, declare the following parameters: | [toc] |
<parameter class="com.jaspersoft.commons.semantic.Schema" isforprompting="false" name="slSchema" /> <parameter class="com.jaspersoft.commons.semantic.datasource.SemanticLayerFactory" isforprompting="false" name="slFactory" />
Declaring paramters to pass from between the main report and subreport
In main report, declare the above parameters to pass to subreport (This is done within the tag):
<subreportparameter name="slSchema"> <subreportparameterexpression> <!--[CDATA[$P{slSchema}]]--> </subreportparameterexpression> </subreportparameter> <subreportparameter name="slFactory"> <subreportparameterexpression> <!--[CDATA[$P{slFactory}]]--> </subreportparameterexpression> </subreportparameter>
Note: Note that these parameters can be added through the iReport UI even though they are represented as the resulting xml.
Recommended Comments
There are no comments to display.