I am using JasperReports with Spring MVC for reporting in my application.
Basically I first design reports in iReport 4.1.1 and then put the resulting .jasper file in my class path via jasper-view.xml
When the request comes, the controller puts the required parameters from Session to Parameter Map and generates report.
The scenario is there are about 15 subreports in my main report.
Out of all these reports, only reports which match the criteria (passed as parameters) are printed (controlled via “Print When” option of the Band)
And my question is: if my report is not to be printed does it gets executed (i.e. the query inside it)?
or is it simply skipped?
My reason for asking this question is that report generation takes quite a long time (around 2s, which is too long for my application according to me).
Thanks.
If you look at the source code for ‘Jasper Reports’, the logic says that the ‘printWhenExpression’ is evaluated first and then the report element is filled, if it is to be printed.
Below is a method called ‘fillNoData‘ from JRVerticalFiller.java (version 4.0), which says so:
What you need to look into, is how the usage of subreports affects performance and memory usage. It looks like you have too many subreports embedded in the main report. Here’s something from this JasperForge link:
Is there performance concerns with Subreports?