...
Code Block |
---|
SELECT * FROM INVOICES WHERE INVOICE_NUMBER = ${INVOICE_NUMBER_PARAMETER} |
Controlling the visibility of sub-reports
Pentaho-Reporting offers two ways to influence, whether a sub-report will be visible (and thus will be executed) during the report processing.
By setting the "visible" style-key, a sub-report can be hidden or shown while the master-report is processed. Any formula or expression on that style-key will be evaluated in the context of the parent report. Therefore all the parent's fields are available, while at the same time none of the sub-report's fields or the sub-report's status or data are available. If the sub-report is invisible the reporting engine will not execute the query or any of the expressions of the sub-report.
The attribute "common::sub-report-active" controls the visibility of the sub-report within the data-context of the sub-report. The reporting engine will execute the sub-report's query and also initializes all expressions defined for the sub-report. When the "sub-report-active" expression evaluates to false by either returning a boolean value "false" or the string "false", the reporting engine will stop the processing of the sub-report and continue with the next report state.
The "common::sub-report-active" attribute's static value is not evaluated.