Robert M.
Robert M.

Reputation: 1367

Jasper Reports Save PDF to disk

I'm using Jasper Reports within Spring. Is it possible to let Jasper generate the PDF of the report and save it to the file system?

Upvotes: 3

Views: 4136

Answers (2)

ig0774
ig0774

Reputation: 41247

Of course. In fact, JasperReports includes an export parameter for doing just that. Basically, you setup your exporter however you are doing so now and set the JRExportParameter.OUTPUT_FILE_NAME parameter to the name of the file you want to save the report as, and then export the report as per normal.

Upvotes: 3

anon
anon

Reputation: 1061

You can write the bytes received from JRPdfExporter to a local file instead of the response stream. The exact solution will depend on how you are using Jasper in your application.

Upvotes: 0

Related Questions