2001 JI Open Discussion Posted August 21, 2006 Share Posted August 21, 2006 By: Diego - diego_benedicto Two or more jasper files in one pdf only 2005-06-08 08:49Hello, I have some jasper files generated with Ireport and I need to send to the browser one pdf only from 2 or more jasper files, is it possible? Thanks in advance, Diego By: Daren O - rckrll106 RE: Two or more jasper files in one pdf only 2005-06-08 09:20Before exporting to pdf, you can take your pages from one JasperPrint object and add them to the other (only if your page layouts are the same - meaning same width, height, etc...). see in tha api: getPages addPage Hope this helps. By: Vinod Kumar Singh - vinodsingh RE: Two or more jasper files in one pdf only 2005-06-08 21:38I think itest api provides an example to concat 2 pdf files, look at them By: Doug Berkland - berkland RE: Two or more jasper files in one pdf only 2005-06-08 22:09If you are using net.sf.jasperreports.engine.export.JRPdfExporter to get the byte stream to send to the browser, you can call net.sf.jasperreports.engine.export.JRPdfExporter.setParameter(JRExporterParameter.JASPER_PRINT_LIST, list) where list is an ArrayList containing the JRPrints to be concatenated into one PDF. e.g. List printList = new ArrayList(); printList.add(jrPrint1); printList.add(jrPrint2); ByteArrayOutputStream pdfOutput = new ByteArrayOutputStream(); JRPdfExporter exporter = new JRPdfExporter(); exporter.setParameter(JRExporterParameter.JASPER_PRINT_LIST, printList); exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, pdfOutput); exporter.exportReport(); byte[] results = pdfOutput.getBytes(); By: kootjekip - kootjekip RE: Two or more jasper files in one pdf only 2005-06-09 11:10I fixed it already posting code tomorrow thx for your help 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