JasperETL: schedule report and encrypt its output

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:

  1. tREST
  2. tWaitForFile
  3. tFileArchive
  4. tSendMail
  1. 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:

  2. "Content-Type" = "application/job+json"
  3. "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/

  4. 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.
  5. 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").

  6. Finally, we email ZIP file to specified recipients. Job execution is finished
Feedback
randomness