-1

I'm using navigateToURL to open a PDF file generated by Jasper and it's working well. Now I was asked to send an email with the PDF file as an attachment. We are using Velocity to send emails in our application but, to send attachments, we have to have the file saved somewhere and have the info of the path and filename. Is it possible to save to file opened by navigateToURL?

I'm using Flex SDK 4.9.1.

Thank you.

1 Answers1

0

Are you using JasperExportManager.exportReportToPdfStream() method to show the PDF?

If so, try to use JasperExportManager.exportReportToPdfFile().
Then you can save the PDF at server.

JasperPrint jasperprint = JasperFillManager.fillReport(jasper, paramMap, con);
// Streaming pdf now?
response.setContentType("application/pdf");
JasperExportManager.exportReportToPdfStream(jasperprint, response.getOutputStream());

// Save the PDF somewhere.
JasperExportManager.exportReportToPdfFile(jasperprint, path);
Yasuyuki Uno
  • 2,417
  • 3
  • 18
  • 22
  • Thank you for your reply. Meanwhile, my manager changed my priorities and this is no longer urgent for him. When I go back to this, I will try your solution. – user3682705 Oct 21 '15 at 07:08