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

Combining reports?


phlake

Recommended Posts

I have a situation where I have two working Jasper reports and a need to merge them somehow to create a single PDF.

My datamodel is one to many: I have an object Foo that references zero, one, or more instances of Bar.

My first report prints the details of a (singular) Foo in landscape orientation. My second report prints one to four Bars per page in portrait orientation. Both JRXML's are written and tested.

Can I merge these two reports together? Ideally, I'd like to have a single JRXML and give a List of one Foo as a JRBeanCollectionDataSource to Jasper. Then Jasper would print the Bar pages if the Foo had more than zero Bars. Of particular concern to me though is that each report has a different <background> and the orientations differ. Can this be handled with subreports maybe?

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Hello,when you export your reports, you pass a JASPER_PRINT argument to the exporter, right ? This is the object you get when you fill your JasperReport object.But you can also give the exporter a list of reports to be printed. You then just have to pass the argument JASPER_PRINT_LIST, and give a collection of <JasperPrint>, so your reports will be merged.I hope that was your question.

 

Regards,

Morgan

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