Jump to content
Changes to the Jaspersoft community edition download ×

JRPrintServiceExporter performance

Recommended Posts

By: The Dude - xbenveniste

JRPrintServiceExporter performance

2006-03-02 11:05



For a very simple report displaying very few data from a single record, the following instructions took around 4 seconds to achieve.


JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, parameters, jrDatasource);

JasperPrintManager.printReport(jasperPrint, false);



On the other hand, if I use the following instructions, it took nearly up to 50 seconds to achieve!


JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, parameters, jrDatasource);


JRPrintServiceExporter exporter = new JRPrintServiceExporter();


exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);

exporter.setParameter(JRPrintServiceExporterParameter.PRINT_REQUEST_ATTRIBUTE_SET, printRequestAttributeSet);

exporter.setParameter(JRPrintServiceExporterParameter.PRINT_SERVICE, suitablePrintService);





In the two cases, the filling process is very fast (around 100ms). The huge difference comes from the "exportReport()" command.


Any idea why the second method took so long ?

Any idea how I can reduce the process time of this second method ?

I need to use the second method in order to be able to specify the printer address, several print request attributes.


I'm using JasperReports 1.1.1 under windows xp sp2 with JDK 1.5.





By: The Dude - xbenveniste

RE: JRPrintServiceExporter performance

2006-03-03 10:21

In my report, I use the build-in str() method in textFieldExpression to get access to the resource bundle passed as a parameter to the report at runtime.

It appears that, if I don't specify a resource bundle at runtime, the exportReport is as fast as the printReport !!!

Does the exportReport process the evaluation of resource bundle content differently ?

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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