Hi all,
I need to generate PDF document with Jasper Reports from a Faces
Portlet.
My portlet already generates XLS document with JExcel; to do this, from
my action method, I forward the request to a Servlet that renders
binary data.
Here a snippet...

byte[] bytes = null;

bytes = exportDataTableToExcel(exportBean);

arg1.reset();
arg1.setContentType("application/vnd.ms-excel");
arg1.setHeader("Content-disposition", "attachment;
filename=export.xls");
arg1.setContentLength(bytes.length);

ServletOutputStream servletOutputStream = arg1.getOutputStream();
servletOutputStream.write(bytes, 0, bytes.length);
servletOutputStream.flush();
servletOutputStream.close();

Similar snippet to generate PDF document doesn't work fine, window
open/save document doesn't appears.

byte[] bytes = null;
bytes = MngExportData.exportDataToPdf(new Vector(), new HashMap(),
getServletConfig().getServletContext().getRealPath ("/pdf/rpt_export_MTM.jasper"));
arg1.reset();
arg1.setContentType("application/pdf");
arg1.setHeader("Content-disposition",
"attachment; filename=export.pdf");
arg1.setContentLength(bytes.length);

ServletOutputStream servletOutputStream = arg1.getOutputStream();
servletOutputStream.write(bytes, 0, bytes.length);
servletOutputStream.flush();
servletOutputStream.close();

Can anyone help me?

Thanks in advance.