coldblood22 Posted February 7, 2008 Share Posted February 7, 2008 It takes too much time for the reports to load is what i experienced.I wrote 2 java files to develop a report. In the first report i designed the .jrxml file using iReport.All the fields were made in the design time. A db connectionwas made and a simple 'Select' query was executed.What i noticed is that the ' JasperCompileManager.compileReport(design); 'takes some time to compile. It took 5 seconds to compile.2 secs to fill the report and 2 secs to view.So in all it took more than 9 secs for the report to appear on the screen.I feel 9 secs is too slow for a report as simple as this to generate. In the second report i took a blank .jrxml file without any fields.Using the jasperreports api i designed all the fields at run-time.I declared all parameters on runtime too. The query is also set at runtime.It took 13 secs to compile, 5 secs to fill and 2 secs to view.So in all 20 secs for the report to appear.20 secs is too long. Is this normal. Is there any way to boost the performance ??Even the slightest intention of help would be highly appreciated. Link to comment Share on other sites More sharing options...
ns69 Posted February 11, 2008 Share Posted February 11, 2008 In the first report, you can try using the compiled reports (*.jasper files), instead of .JRXML files. In the code below the reportFile is pointing to the *.jasper file. Here is the code that I used: JasperReport jasperReport = (JasperReport) JRLoader.loadObject(reportFile); JasperPrint jasperPrint = net.sf.jasperreports.engine.JasperFillManager.fillReport(jasperReport, parametermap, new net.sf.jasperreports.engine.JRResultSetDataSource(rs)); Good luck!! Link to comment Share on other sites More sharing options...
coldblood22 Posted February 12, 2008 Author Share Posted February 12, 2008 Hey ns69, thanks a lot for your help.I checked using the .jasper files and the execution time taken was very less. Now the problem is that most of the reports i am designing is at runtime so i need a solution for that. Thanks again. Link to comment Share on other sites More sharing options...
lucianc Posted February 14, 2008 Share Posted February 14, 2008 If you need to generate and compile reports at run-time, make sure you use the JDT-based report compiler (more details in this FAQ). If the compilation time is still a problem, you should consider (if possible) implementing a cache of compiled reports so that the number of report compilations is reduced to minimum. Regards,Lucian Link to comment Share on other sites More sharing options...
hari.sunku Posted March 11, 2008 Share Posted March 11, 2008 Hi, why not we user .jasper files instead of jrxml files. if u use jrxml files first we have to compile and we have to keep in the memory for the future refernce calls instead of use jasper files(compiled files), it will be save 1. no need to compile2. no need to keep in cache. if any thing wrong, please let me know.... 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