[jasperreports-questions] Merge multiple JasperPrint Objects
jeipackMon, 16 Apr 2007 04:55:31 -0700
Hi
I just want to show several JasperPrint Objects in only one JRViewer. Is
there a function to concat 2 or more JasperPrint Objects to one JasperPrint
Object? or something like that?
In pseudo code:
JasperPrint jp1 = JasperFillManager.fillReport(url.openStream(), parameters,
new JRBeanCollectionDataSource(inspBean));
JasperPrint jp2 = JasperFillManager.fillReport(url.openStream(), parameters,
new JRBeanCollectionDataSource(inspBean));
JasperPrint jp = jp1+jp2
jrviewer= new JRViewer(jp);
I hope its clear what i mean.
Thanks for your help!
jeipack
http://www.mail-archive.com/jasperreports-questions@lists.sourceforge.net/msg00728.html
a slimier question is [update] http://stackoverflow.com/questions/2666001/how-to-merge-two-pdf-documents-into-a-single-report-in-jasperreports/8278526#8278526
unfortunately the solution is build a sub report and use the 2 different DataSource or what ever connection you used
but there is an easy way to get over with this question :D
just simple no new reports ..... Wolaah
ok lets do it
ok we have over 2 records ..lets take our first record jp1 and add jp2 content into it
This work like a charm .. with couple of loops you can merge any number of report together .. without creating new reports
JasperPrint jp1 = JasperFillManager.fillReport(url.openStream(), parameters,
new JRBeanCollectionDataSource(inspBean));
JasperPrint jp2 = JasperFillManager.fillReport(url.openStream(), parameters,
new JRBeanCollectionDataSource(inspBean));
ok we have over 2 records ..lets take our first record jp1 and add jp2 content into it
List pages = jp2 .getPages();
for (int j = 0; j < pages.size(); j++) {
JRPrintPage object = (JRPrintPage)pages.get(j);
jp1.addPage(object);
}
JasperViewer.viewReport(jp1,false);
Questions are welcome


1 comments:
මම හරි ආසාවෙන් කියවපු දෙයක් තමයි OOP සිංහලෙන් පැහැදිලි කරල තිබුනු ලිපි ටික. ඒත් එ ටික නවත්තලා අළුත් මාතෘකාවකට බැහැලනෙ.අපි වගේ java වලට අළුත් අයට ඒ ලිපි සෙට් එක ගොඩක් වැදගත්.බරිද දිගටම ආයෙත් ඒ ගැන ලියන්න. මේක ඉල්ලීමක් විතරයි සහෝ......
Post a Comment
මේ ගැන මොකද හිතන්නේ ?