Your browser was unable to load all of the resources. They may have been blocked by your firewall, proxy or browser configuration.
Press Ctrl+F5 or Ctrl+Shift+R to have your browser try again.

Saving Jasper Report output #62

#1

Dear All,

How to save Jasper Report output(pdf) directly to Database without showing the output to user.

  • replies 5
  • views 650
  • likes 0
#2

Sure,

simply use the function get_report() instead of show_report(). It will return a blob which you can simply insert into the database.

Best,
~Dietmar.

Hi,
We are unable to save the Jasper Report output to a specific directory on the server. We are using Tomcat 9 and JasperReportsIntegration-2.4.0.0 on a Windows OS.
We are using test platform on jasper integrator below is the url generated.
http://10.20.30.39:8181/JasperReportsIntegration/report?_repName=test&_repFormat=pdf&_dataSource=default&_outFilename=&_repLocale=&_repEncoding=&_repTimeZone=&_printIsEnabled=&_printPrinterName=&_printPrinterTray=&_printCopies=&_printDuplex=&_printCollate=&_saveIsEnabled=true&_saveFileName=martin.pdf
attached is the error

error.jpg --------------------------------------- We have configured the following settings in the application.properties file located at C:\Program Files\Apache Software Foundation\Tomcat 9.0\webapps\JasperReportsIntegration\WEB-INF\conf folder

Save File on Server

[saveFileOnServer]
isEnabled=true
saveFile=true
directoryWhitelist=C:\Program Files\Apache Software Foundation\Tomcat 9.0\webapps\JasperReportsIntegration

Can you recommend configuration we need to save a file in specific folder on server.

#4

Please try to use an absolute path for the filename:
Greenshot 2024-04-23 16.27.11.png

And yes, I could figure this out and get a better error message :laughing:

Thank You Very Much , subjected issue is resolved :grinning:
Report output file is generated on server directory,
Solution: As suggested by Mr.Dietmar , passed complete _saveFileName parameter path [specified in directoryWhitelistparamter from application.property file] of output file.

Below is sample url looks like:

http://10.20.30.39:8181/JasperReportsIntegration/report?_repName=test&_repFormat=pdf&_dataSource=default&_outFilename=&_repLocale=&_repEncoding=&_repTimeZone=&_printIsEnabled=&_printPrinterName=&_printPrinterTray=&_printCopies=&_printDuplex=&_printCollate=&_saveIsEnabled=true&_saveFileName=C:\Program Files\Apache Software Foundation\Tomcat 9.0\webapps\JasperReportsIntegration\santosh.pdf

#6

Wonderful! Happy to hear that. :grin: :thumbsup: