Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

Export to PDF and Export to Excel buttons stop working

SA-39911

Summary



The Export to PDF and the Export to Excel buttons do not work the second time.


Error Messages



Not Applicable


Steps to Reproduce

  1. Configure a button to call an activity that exports a section to PDF
  2. Configure another button to call an activity that exports a section to Excel
  3. During runtime, click each of these buttons a second time

Root Cause



An issue in the custom application code or rules. The button freezes after calling the activity once.

Resolution



Perform the below local-change:

1. Add the JavaScript function below to the UserWorkForm.


<script>
function downloadFile(activityName, className, applicationName, fileName, fileType){
var suURL = SafeURL_createFromURL(pega.u.d.url);
suURL.put("pyActivity", activityName);
suURL.put("pyClassName", className);
suURL.put('ApplicationName', applicationName);
suURL.put('FileName', fileName);
suURL.put('FileType', fileType);

var formEle = document.createElement('form');
formEle.id = "download_file";
formEle.method = "POST";
formEle.action = suURL.toURL();
if(pega.env.ua.webkit)
formEle.target = "";
document.body.appendChild(formEle);
formEle.submit();
document.body.removeChild(formEle);
}
</script>

2. Configure the run script on download link or button and call this function

Suggest Edit

Published August 2, 2017 - Updated October 8, 2020

Did you find this content helpful? Yes No

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us