Page 1 of 1

Jasper Reports PDF download folder

PostPosted: Tue Mar 16, 2021 6:04 pm
by Richard1521662995
With NG Client when i run a Jasper report and pass null as the third parameter (output options) and set the outputType to plugins.jasperPluginRMI.OUTPUT_FORMAT.VIEW the pdf has always downloaded into the users download folder. Have a new system where the file is downloaded onto a folder on the server. How can i change this so that the file downloads locally?

Thanks

Re: Jasper Reports PDF download folder

PostPosted: Fri Mar 19, 2021 12:30 am
by mboegem
Hi Richard,

try to pass Boolean true as 3rd parameter.
This should make plugins.jasperPluginRMI.runReport return a byteArray

Then write the file as below, this should put in your download folder
Code: Select all
plugins.file.writeFile('myReport.pdf', Array<byte>, 'application/pdf')


Hope this helps

Re: Jasper Reports PDF download folder

PostPosted: Sun Mar 21, 2021 2:38 pm
by Richard1521662995
Hi Marc,

Thanks, looks this this should solve he problem.