Support Article
Export to PDF does not download PDF
SA-71354
Summary
Export to PDF does not download PDF post upgrading to Pega 7.4.
Error Messages
There has been an issue; please consult your system administrator
Steps to Reproduce
- Configure an onclick event by section refresh
- Invoke the HTMLToPDF activity by sending the HTML stream. HTML stream is null and an error occurs
Root Cause
A software use or operation error. The incorrect configuration of using ReloadSection to download the PDF is used.
Resolution
Perform the following local-change:
Use the below RunScript:
<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.trget = "";
document.body.appendChild(formEle);
formEle.submit();
document.body.removeChild(formEle);
}
</script>
Published December 2, 2021
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.