Jump to content
Changes to the Jaspersoft community edition download ×

Make one DB call 4 multiple types of reports

2005 IR Help

Recommended Posts

By: Sreenandan - sjalis

Make one DB call 4 multiple types of reports

2004-04-28 22:36

Hello Teodor,

I am creating three types (PDF, HTML & CSV) of reports. In order to avoid executing the expensive sql query being executed 3 times, I make use of the JasperPrint object. Now, to make sure that the CSV o/p is properly formated I have a parameter reportType. If the reportType is "CSV", I do not display things like the page number. But, because of this one parameter, I need to create two instances of JasperPrint (one with reportType "nonCsv" & other with "csv") thereby making 2 costly sql queries to the db. Is there any way I can reduce this to one single sql call. Thank you.






By: Chuck Deal - cdeal

RE: Make one DB call 4 multiple types of reports

2004-04-29 05:15

Instead of embedding your query in the report, create a JRDatasource and pass that to the reports.


The sql would be run the one time to initialize the datasource and then you could use the datasource multiple times...


Actually, you might need to clone the datasource...

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