If you are on Pega 7.1.7 or above, you can reuse or use as reference, this activity @baseclass.pxConvertResultsToCSV to convert page list to CSV format. You can then leverage @baseclass.SendEmailNotification activity passing an AttachmentPage of class Data-EmailAttachments by copying the CSV data on to the AttachmentPage.
Thanks for the quick response. Currently i am using MSOGenerateExcelFile to generate the excel file.
Note: i don't have any workobject here, my scenario is like batch process where i need to get some results from db and export them to excel and send it to people as attachment on recurring basis like 4 times in a day.
<<<You can then leverage @baseclass.SendEmailNotification activity passing an AttachmentPage of class Data-EmailAttachments by copying the CSV data on to the AttachmentPage
Can you please explain in detail or give me any reference.
I have tried below approach.
1) Call MSOGenerateExcelFile with steppage as AttachmentPage(of class Data-EmailAttachments) but i am not seeing attachment content in that page.
2)Use the java method to write the following piece of code.
If i hardcode the AttachementPage.pyAttachments(1).pyData="test" in the attachmentpage i am getting the attachment.
------------Start of code----------------------------- ClipboardPage page_EmbedAttachment = null, page_AttachmentPage = tools.findPage("AttachmentPage");
page_EmbedAttachment.putString(".pyData",datatoattach);// datatoattach should contain a Base 64 Encoding of the entire attchment from excel file page_EmbedAttachment.putString(".pyName","XYZ.xls"); page_EmbedAttachment.putString(".pyDecode","true"); page_EmbedAttachment.putString(".pyRemoveXML","false");