Search code examples
jasper-reportssubreport

I need subreport just for getting some value (return value). Is it possible to hide subreport but stay it runnable?


I have a report with a sub-report. The sub-report is in the details band. And I'm getting some return values from that sub-report. I want to hide the sub-report from the details band when the report is generating (even though sub-report is empty or not). But I want to receive the return value even if the report is hidden. Is there any way to achieve this?

I have tried new Boolean(false) in Print When Expression of the sub-report. But then the main report can't receive sub report's return value.

I'm using iReport 5.6.0


Solution

  • The way I achieved that,

    I did set the font size of the subreport elements to "0" and the band heights to "0" So the subreport doesn't need much space so report page size can be decreased too.