Jump to content
We've recently updated our Privacy Statement, available here ×

Report Generation, very slow performance.


coldblood22

Recommended Posts

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.

Link to comment
Share on other sites

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

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

  • 4 weeks later...

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....

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...