Jasper Reports PDF download folder

Questions and answers on developing, deploying and using plugins and JavaBeans

Jasper Reports PDF download folder

Postby Richard1521662995 » Tue Mar 16, 2021 6:04 pm

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
Richard Clarke
acss.co.uk
Richard1521662995
 
Posts: 15
Joined: Wed Mar 21, 2018 10:09 pm

Re: Jasper Reports PDF download folder

Postby mboegem » Fri Mar 19, 2021 12:30 am

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
_____________________
Marc Boegem
Solutiative / JBS Group, Partner
• Servoy Certified Developer
• Servoy Valued Professional
• Freelance SAN Developer

Image
User avatar
mboegem
 
Posts: 1557
Joined: Sun Oct 14, 2007 1:34 pm
Location: Amsterdam

Re: Jasper Reports PDF download folder

Postby Richard1521662995 » Sun Mar 21, 2021 2:38 pm

Hi Marc,

Thanks, looks this this should solve he problem.
Richard Clarke
acss.co.uk
Richard1521662995
 
Posts: 15
Joined: Wed Mar 21, 2018 10:09 pm


Return to Plugins and Beans

Who is online

Users browsing this forum: No registered users and 8 guests

cron