Conditional Executing subreports in iReport

ireportjasper-reports

Am using more than 100 subreports and some Detail band in my main report

And given conditional Visibility of the sub reports / Detail Band based on the Parameter selection in main Report

<subreport>
                <reportElement uuid="9f36c3cb-7e29-4040-a14e-6a91775e89e4" x="0" y="35" width="555" height="47">
                    <printWhenExpression><![CDATA[$P{disp} == 1]]></printWhenExpression>
                </reportElement>

. But the performance is very very slow in main report.

While selecting single sub report executes in seconds. The same report in main report executes in hours.

According to my view,

All the Sub reports and detail Band executes and finally conditional visibility is working. Can we Control executing sub reports?

Best Answer

you could possibly use an own detail band for each subreport, and set each with the "print when expression". like this, the subreport should not be executed at all.

in case you are using datasets in the main report for each subreport (however that should work), move the queries to the subreports.

Related Topic