Question
XOSERVE
GB
Last activity: 30 Jul 2021 10:26 EDT
Password protecting an excel file (.xlsx) in Pega
We are looking for a way to password protect an excel file generated from Pega and sending it as an attachment via email.
Below page from the Apache POI provides a code snippet for encrypting .xlsx files with a password:
http://poi.apache.org/encryption.html
We have tried to implement it by using below steps:
1) Generate an excel file using @baseclass.pxGenerateExcelFile which will be stored in ServiceExport path
2) Use the apache agile encryption method for XML based formats to encrypt the file in the ServiceExport path
3) Read the file and copy the content onto the attachment page and send an email by referring the attachment page
It is sending the email but the attachments are not password protected.
Workarounds tried:
1) Instead of sending email, we used @baseclass.DownloadFile to check if the file is actually encrypted but it is not.
Request your help if you have come across similar requirement to password protect an excel file.
Thanks!