Jump to content
Changes to the Jaspersoft community edition download ×

Two or more jasper files in one pdf only


Recommended Posts

By: Diego - diego_benedicto

Two or more jasper files in one pdf only

2005-06-08 08:49

Hello,

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:20

Before 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:38

I 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:09

If 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:10

I fixed it already posting code tomorrow thx for your help

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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