Posted: 23 Aug 2017 17:56 EDT Last activity: 23 Aug 2017 23:42 EDT
Best option to convert PDF to Excel from activity?
We have current requirement in PRD is like a Agent pulls data from DB using RD and then generate a PDF before sending it as an email attachment. Now the new req is to change PDF to excel as an enhancement. What is the best possible option to implement it? Here are my options
1) modify existing activity to convert PDF to excel by using any ootb feature??If yes, any code or ootb feature for this?
2) build fresh logic to generate excel after calling RD in the existing activity? If yes, any code or ootb feature for this?
a. Configure report definition (I think you already have this)
b. Create a short cut for this report definition
c. Make sure this short cut appears only for Administrators, if this should not be exposed to other users
d. From the report browser, configure Schedule for this report
e. Modifications to this schedule can be done from designer studio as well: Reporting -> Components -> Scheduled Tasks
Note: Email recipient(s) should have operator ID record in PRPC system. When recipients open this excel attachment from email, a warning gets displayed which can be ignored. This is a known issue with Pega 7.2.2
Thank you Murali. Let me tell you how we designed earlier.
We have an activity =>
1) Pull the Data from RD by passing the Params to it by using "Call Rule-Obj-Report-Definition.pxRetrieveReportData"
2) Call pzViewExportToPDF
3) Java code to read the PDF bytes and encode into Base64
4) Email logic to attach the above PDF and send the email.
This activity is being called from the wrapper activity with some other logic and that wrapper activity is called from Agent. Hope this helps. I saw there is a similar activity =>Call pzViewExportToExcel instead of step 2 but I am not sure on how to attach the final excel using java code like in Step 3. For now, I am getting the pyViewData parameter value after using this activity:pzViewExportToExcel call. What next? How I bring this pyViewData to my AttachmentPage of Data-EmailAttachments? Feel free to chime in.
I am able to generate the excel and attaching it to email. Here is the step I have added in setting the properties of AttachmentPage as I mentioned above.
AttachmentPage .pyAttachments(<LAST>).pyData= @Base64Encode(Param.pyViewData). No java code is needed after Step2. Direct Property-Set for the AttachmentPage. After doing all the properties set, call Step4 to send the email.
I need to test all the scenarios with data to be filled in Excel with the logic.