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

Two reports in one PDF


Recommended Posts

By: Sergio da Silva Rodrigues - rod9h

Two reports in one PDF

2006-02-13 15:24

Hello,

 

how i can generate reporst with diferente structures as just one for PDF ? Can i create two or more jrmxl and merge them in one stream ? How can i do this ?

 

Thanks in advance

Rod - Brazil

 

 

 

 

By: russelldb - russelldb123

RE: Two reports in one PDF

2006-02-14 01:47

Hi Rod,

If you create your two (or more!) jrxmls and then compile and fill them as normal. You will then have two JasperPrint objects.

 

The JRExporterParameter.JASPER_PRINT_LIST can then be set on the JRPdfExporter (or whatever other exporter). If you put your two reports in a java.util.List and pass them as the value of the JRExporterParameter.JASPER_PRINT_LIST you are done.

 

You then set your file, or FileOutputStream or whatever on the exporter and call exportReport();

Your two JasperPrints will be exported to the one stream/file/writer.

 

Good luck!

 

Russell

 

 

 

 

By: Sergio da Silva Rodrigues - rod9h

RE: Two reports in one PDF

2006-02-16 12:11

Thanks Russel,

the solution works, but i have to use deprecated method and class JasperManager.fillReport. But it works.

 

 

 

 

By: dime_bag - dime_bag

RE: Two reports in one PDF

2006-02-17 04:02

Is there a possibility to integrate two or more completely seperately filled reports into a single reportfile of type JasperPrint, that can be exported as one report?

 

 

 

 

 

 

By: russelldb - russelldb123

RE: Two reports in one PDF

2006-02-21 01:53

Sergio,

Why do you have to use a deprecated method ? I'm not sure how you come by the JasperPrint objects (fill the reports) has any bearing on exporting them to the same file.

 

Dime_bag,

The method I have described above puts any number of unrelated JasperPrints into the same Output so that you can export them as one report. I do not know how to create one JasperPrint from multi JasperReports, why do you need to ?

 

Regards

 

Russell

 

 

 

 

By: Christiaan - christiaan_se

RE: Two reports in one PDF

2006-02-22 07:23

"I do not know how to create one JasperPrint from multi JasperReports, why do you need to ?"

 

The reason I can think of is to have the pagenumber not started from 1 again for the second report, so it really looks like one report.

 

 

 

 

 

By: Aegis Thorne - aegisthorne

RE: Two reports in one PDF

2006-02-22 07:29

I wish I'd found the post about jasper list before coming up with the following code, but here goes:

 

https://sourceforge.net/forum/forum.php?thread_id=1446411&forum_id=113530

 

My solution does not handle the page number reordering, since this combination step happens after the pages are run. This trick can be used to do all manner of whacky things though.

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