Question
World Bank
US
Last activity: 4 Oct 2018 13:54 EDT
Create a Excel file from pagelist
I want to write activity where i need to form excel from pagelist data and send this excel file as attachment in email in agent.
Please let me know the process.
Thanks
hari
**Moderation Team has archived post**
This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Infosys
NL
Hi HariSureshBabuG5756,
You can use OOTB activity MSOGenerateExcelFile. Call this activity keeping your pagelist (or data page ) as step page. It takes three parameters, 1. FSFileName - Name of the excel created, 2. TemplateRFB - Template name (format : "excel!TemplateName!xlsx") , 3. DownLoadFile - true/false. Prior to using this activity, create a template excel file and define the column header and property reference for column value. Create a binary file in PRPC and upload this excel. This template excel will have the details of the properties you want to send to the output excel and its name is required for the second parameter.
Let me know if you need any other details.
Thanks
Sumit
Morgan Stanley
IN
Hi Sumit,
I followed your steps and was able to export the pagelist elements to an excel. However, the download is happening only for one time. If I try to click the button (where the activity is configured)for the second time then the export download is not happening.
Please suggest if any other configurations are to be followed.
Tech Mahindra Ltd
IN
Hi MohanR19, Can you please elaborate on how did you export pagelist elements to an excel.? and please give binary file details.
Thanks
Pegasystems Inc.
IN
Hi,
Thank you for posting your query in the PSC. This looks like an inactive post and hence, we suggest you create a new post for your query. Click on the Write Post button here. Once created, please reply back here with the URL of the new post.
You may also refer this discussion link as a reference in the new thread.
-
David Bartak Raphaël TROLONGE
Aaseya IT Services Pvt LTD
SA
This is a known issue at Pega side. After the refresh section download, the browser couldn't identify the second time refresh download as a new event. Please perform a run script action on your click action instead of Refresh section. Below is the code for the run script function. You can add this in userworkform or JS file if have any in your application.
Passed the activity name you created for downloading the file and pass the file name and template name in the parameters while providing this function in run script
This is a known issue at Pega side. After the refresh section download, the browser couldn't identify the second time refresh download as a new event. Please perform a run script action on your click action instead of Refresh section. Below is the code for the run script function. You can add this in userworkform or JS file if have any in your application.
Passed the activity name you created for downloading the file and pass the file name and template name in the parameters while providing this function in run script
function exportToExcelPlanning(TemplateName,TemplateFile)
{
//var exceedemptemplate = "excel!ExceedEmployee!xlsx"
var form = document.createElement('form');
form.id = "formExportViewToExcel1";
form.method = "POST";
//form.target = "_target";
document.body.appendChild(form);
var frm = document.forms["formExportViewToExcel1"];
//Support for safari
if(pega.env.ua.webkit)
frm.target = "";
var oSafeUrl = new SafeURL("X-Y-Z.ActivityName");
oSafeUrl.put("TemplateRFB",TemplateName );
oSafeUrl.put("FSFileName",TemplateFile );
frm.action = oSafeUrl.toURL();
var doc= frm.action
frm.submit();
document.body.removeChild(form);
}
Virtusa Corp.
US
What should be there is Template? Can you add a screenshot of it? will it include column headings we want to see and below each heading the corresponding property name ? Appreciate your response.
-
Abhishek S R
Virtusa
IN
Hi HariSureshBabuG5756,
You can aslo use OOTB activity pzMSOGenerateExcelAndSaveToWorkFileAttachment for generating the excel file.It will store the excel file content in TempDataWorkAttachFile.pyAttachStream in base64 format.
Step-1 -- As mentioned by Sumit create a binary file and upload the excel template.
Step-2 -- Call pzMSOGenerateExcelAndSaveToWorkFileAttachment activity by giving the parameter keysSourceRFB- Template name (format : "excel!TemplateName!xlsx").
Step-3 -- Create an AttachmentPage(Embed-EmailAttachment) with the following data and send this AttachmentPage as parameter for the SendEmailNotification Activity.
AttachmentPage.pyAttachments(<APPEND>).pyName = Attachment Name(Example : ExportData)
AttachmentPage.pyAttachments(<LAST>).pyData = TempDataWorkAttachFile.pyAttachStream (Path which has the excel file content output of pzMSOGenerateExcelAndSaveToWorkFileAttachment )
AttachmentPage.pyAttachments(<LAST>).pyType = sheet format (Example: "xlsx")
AttachmentPage.pyAttachments(<LAST>).pyDecode = true
This helps to send email with the excel file as attachment.
Thanks,
Mounika Y.
Datum Cybertech Pvt Ltd
IN
Hi Mounika,
I have the same requirement, but I dint found that activity(pzMSOGenerateExcelAndSaveToWorkFileAttachment) in 7.1.9. In which class does this activity exist.
Thanks,
sahitya k.
Virtusa
IN
Hi Sahitya,
pzMSOGenerateExcelAndSaveToWorkFileAttachment Activity belongs to PegaAccel-Task-DocumentApp class.
Regards,
Mounika Y.
Ernst & Young
US
Hi Monika,
I tried doing the same by coying the pzMSOGenerateExcelAndSaveToWorkFileAttachment into my WorkPool class. For some reason, i dont see the file getting attached to the WO.
Thanks,
Virtusa
IN
Hi TAMADA10,
Actually it will not attach file to the WO. It will just generate the excel file and stores the file data in the temp page.
Thanks,
Mounika Y.
Verizon Wireless
IN
Looks Like this activity is not available in the Pega 7.3.0 version :(