imanol00 Posted October 23, 2006 Share Posted October 23, 2006 Hello forum users!! I made a big and complex report from two little reports. What I want to know is that if I can make a print preview of this. I mean, with a simple report, I can pass a JasperPrint object as parameter to JasperViewer.viewReport(), but, in this case, I have two JasperPrint objects. There is an implementation of JasperViewer.viewReport() that takes as first parameter a String, but it doesn't work. Anybody can help me? Thanks a lot Link to comment Share on other sites More sharing options...
teodord Posted October 30, 2006 Share Posted October 30, 2006 Hi, If I understand correctly, you want to use the existing JRViewer to display two reports as being only one.The only solution I could think of is to merge the two separate JasperPrint objects into one.This could be achieved by copying pages from one document into the other.Besides pages, I think report-level styles should also be copied.Did not try this lately, but maybe you could give it a try and let us know. Thank you,Teodor Link to comment Share on other sites More sharing options...
imanol00 Posted October 30, 2006 Author Share Posted October 30, 2006 Hello Teodor. Thanks for your help, but I solved my problem in a different way. I think it's an uglier way, but I don't care. What I did is merging the two subreports by doing a loop in my Java program and feeding both subreports with the data several times. All the reports generated are enqueued in a list, and finally I pass this list to a JrPdfExporter as a parameter and voila! I got what I wanted: a report with portrait and landscape pages alternated. Maybe I'll send it just to be the Report of the Month...hehe Thanks for this powerful library!! 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