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 Excel Not working



The user has configured a button on click of which Export to Excel occurs. The process fails on clicking the button a second time.

Error Messages

Not Applicable

Steps to Reproduce

  1. Open the application.
  2. Configure a button. On click of the button, Export to Excel occurs.
  3. Click the button the second time.

Root Cause

Using the  Refresh Section on the button click action to export the file is not recommended because the section is refreshed and the file cannot be downloaded the second time.


Perform the following local-change:
  1. Copy the below JavaScript in the UserWorkForm.

    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'); = "download_file"; 
    formEle.method = "POST"; 
    formEle.action = suURL.toURL(); 
    if( = ""; 


  2. Save it in the client ruleset.

Published August 19, 2019 - Updated December 2, 2021

Was this useful?

0% found this useful

Have a question? Get answers now.

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

Did you find this content helpful?

Want to help us improve this content?

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