TIBCO JasperReports® Server out-of-the-box configuration doesn't support report output encryption. This is a demo on how to workaround this limitaion using Jaspersoft ETL Studio:
Our job consists of 4 components:
- tREST
- tWaitForFile
- tFileArchive
- tSendMail
We start by creating an "immidiate" job using REST API. For this example, we will export sample /public/Samples/Reports/01._Geographic_Results_by_Segment_Report report to PDF/XLSX/CSV formats with timestamped filenames. Files will be stored on local filesystem, but you can use FTP/SFTP/FTPS as well. A PUT request to "http://localhost:8080/jasperserver-pro/rest_v2/jobs/" is made. You can find more information about body contents in Web Services guide
Every special character in HTTP Body has to be escaped. Two headers need to be set:
- "Content-Type" = "application/job+json"
- "Authorization" = "Basic c3VwZXJ1c2VyOnN1cGVydXNlcg=="
String value consists of two parts, "Basic " + Base64 encoded value "username:password". In this case, superuser:superuser is used. You can easily encode your custom credentials here:
https://www.base64decode.org/ - Next we wait for files to be created on filesystem. When files are created (e.g. in "D:/downloads/ETL/JETL-20160704_1411-V6.2.1/workspace/JRS_scheduled_reports" folder), we exit the scanning loop and proceed to encryption part.
- We are creating a ZIP file using certain Filemask (e.g. only PDF/XLSX files) and set a password (e.g. "password") for this ZIP file (e.g. "D:/downloads/ETL/JETL-20160704_1411-V6.2.1/workspace/JRS_scheduled_reports/report_output.zip").
- Finally, we email ZIP file to specified recipients. Job execution is finished
Recommended Comments
There are no comments to display.