Hello,
I'd like to know how can I detect an empty report before loading it with the JRLoader.loadObject() method.
Because when I want to export a report (always the same) with several differents dates given in parameter, I've got white pages in the exported pdf (for each date which has no data in the database source).
Is it possible ? Thank for help.
I'd like to know how can I detect an empty report before loading it with the JRLoader.loadObject() method.
Because when I want to export a report (always the same) with several differents dates given in parameter, I've got white pages in the exported pdf (for each date which has no data in the database source).
Is it possible ? Thank for help.
4 Answers:
Posted on August 11, 2006 at 3:36pm
You want to decide whether a report is empty before you load it? I don't think that's possible.
If you want to decide whether a report is empty, you first need to set whenNoDataType="NoPages" for the report design and then (when you have the filled report) check jasperPrint.getPages().isEmpty().
Regards,
Lucian
If you want to decide whether a report is empty, you first need to set whenNoDataType="NoPages" for the report design and then (when you have the filled report) check jasperPrint.getPages().isEmpty().
Regards,
Lucian
Posted on August 31, 2006 at 7:18am
I explain again, I use this code :
Code: |
<br /> ArrayList<Object> jpl = new ArrayList<Object>();<br /> String fileGen = JasperFillManager.fillReportToFile(reportPath,parameters, bdd.getConnection());<br /> jpl.add(JRLoader.loadObject(fileGen));</td></tr></tbody></table><br /> <br /> I just want to make something like this :<br /> <br /> <table align="center" border="0" cellpadding="3" cellspacing="1" width="90%"><tbody><tr><td><b>Code:</b></td></tr><tr><td><pre><br /> ArrayList<Object> jpl = new ArrayList<Object>();<br /> String fileGen = JasperFillManager.fillReportToFile(reportPath,parameters, bdd.getConnection());<br /> if (!report.isEmpty()) jpl.add(JRLoader.loadObject(fileGen));</td></tr></tbody></table><br /> <br /> But I don't understand how to do with jasperPrint.getPages().isEmpty().<br>Post edited by: seboss, at: 2006/08/31 07:18 |