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 connection
was 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.
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 connection
was 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.
4 Answers:
Posted on February 11, 2008 at 12:18pm
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!!
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!!
Posted on February 14, 2008 at 9:02am
If you need to generate and compile reports at run-time, make sure you use the JDT-based report compiler (more details in [url=http://www.jasperforge.org/jaspersoft/opensource/business_intelligence/j... 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
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
Posted on March 10, 2008 at 8:03pm
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 compile
2. no need to keep in cache.
if any thing wrong, please let me know....
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 compile
2. no need to keep in cache.
if any thing wrong, please let me know....