phlake Posted June 21, 2009 Share Posted June 21, 2009 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 More sharing options...
blaguman Posted June 22, 2009 Share Posted June 22, 2009 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 More sharing options...
phlake Posted June 22, 2009 Author Share Posted June 22, 2009 Aha! JASPER_PRINT_LIST is what I was looking for. Thanks! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now