I want to access a VARIABLE from a JasperReports in my Java code. More specifically, I need to know the REPORT_COUNT and the SUBREPORT_COUNT in my Java code after filling the report. I've tried setting it as a property, but that doesn't work.
The report is scheduled, and I do not want to send the email if there is no data. I've tried setting the "When No Data" to "print 0 pages," and then checking the page count in the java code. This doesn't work if there is data in just the main or the just the subreport. I want it to print 0 pages if either the main or the subreports have no data.
I'm sure this has been asked, but I can't find exactly what I need. If someone could point me in the right direction, it would be appreciated.