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: 39
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 Developer

Image

Partner of Tower - The most powerful Git client for Mac and Windows
User avatar
mboegem
 
Posts: 1743
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: 39
Joined: Wed Mar 21, 2018 10:09 pm


Return to Plugins and Beans

Who is online

Users browsing this forum: No registered users and 9 guests