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

Cannot export to excel multiple times per harness

SA-28992

Summary



Cannot export to excel not more then one time.


Error Messages



Not Applicable


Steps to Reproduce

  1. Create aa Activity.
  2. Call ConverttoCSV method in one of the steps of the activity.
  3. Create a button and call the above activity on buttton click event.

Root Cause



Ajax call is excecuted only once.

Resolution



Place this method in userWorkForm between script tags, call in run-script action 

function downloadCSV() 

var form = document.createElement('form'); 
form.id = "downloadCSV"; 
form.method = "POST"; 
//form.target = "_target"; 
document.body.appendChild(form); 
var frm = document.forms["downloadCSV"]; 
//Support for safari 
if(pega.env.ua.webkit) 
frm.target = ""; 
var oSafeUrl = new SafeURL("Goog-RND-Work-RND.{Activityname}"); 
frm.action = oSafeUrl.toURL(); 
frm.submit(); 
document.body.removeChild(form); 
}

Published October 27, 2016 - Updated October 8, 2020

Was this useful?

100% 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