There is no way to export multiple PDFs together with the Jasper report and JSF2
Here is a code that I use to export a PDF:
HTTPERVILLE RESPONSES httpServletResponse = (HTTPServlet Response) FacesContext .getCurrentInstance (). GetExternalContext (). GetResponse (); HttpServletResponse.addHeader ("content-type", "attachment; filename =" + name + ".pdf"); HttpServletResponse.setContentType ("application / PDF"); SerialOutputStream ServletoptputStream = httpServletResponse.getOutputStream (); JasperExportManager.exportReportToPdfStream (jasperPrint, servletOutputStream); //servletOutputStream.close (); //servletOutputStream.flush (); . FacesContext.getCurrentInstance () responseComplete (); But to export two at the same time, I collected them in:
list & lt; JasperPrint & gt; Jprintlist = New Arrestist & lt; JasperPrint & gt; (); Jprintlist.add (jasperPrint_1); Jprintlist.add (jasperPrint_2); But I do not know how to export them
Do you have any ideas
Thank you in advance
< / Div>
You can use: export.setParameter (JRExporterParameter.JASPER_PRINT_LIST, jprintlist); files for a list of exports link:
No comments:
Post a Comment