seboss Posted August 11, 2006 Share Posted August 11, 2006 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. Link to comment Share on other sites More sharing options...
lucianc Posted August 11, 2006 Share Posted August 11, 2006 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 Link to comment Share on other sites More sharing options...
seboss Posted August 31, 2006 Author Share Posted August 31, 2006 I explain again, I use this code : Code:ArrayList<Object> jpl = new ArrayList<Object>();String fileGen = JasperFillManager.fillReportToFile(reportPath,parameters, bdd.getConnection());jpl.add(JRLoader.loadObject(fileGen)); I just want to make something like this : Code:[code]ArrayList<Object> jpl = new ArrayList<Object>();String fileGen = JasperFillManager.fillReportToFile(reportPath,parameters, bdd.getConnection());if (!report.isEmpty()) jpl.add(JRLoader.loadObject(fileGen)); But I don't understand how to do with jasperPrint.getPages().isEmpty().Post edited by: seboss, at: 2006/08/31 07:18 Link to comment Share on other sites More sharing options...
Alexander Merz Posted August 31, 2006 Share Posted August 31, 2006 Code:JasperPrint jasperPrint =(JasperPrint)JRLoader.loadObject(fileGen);if(!jasperPrint.getPages().isEmpty()) { jpl.add(jasperPrint);} Link to comment Share on other sites More sharing options...
seboss Posted August 31, 2006 Author Share Posted August 31, 2006 Ok, I didn't see that JRLoader.loadObject() return a jasperprint... Thanks a lot Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now