Description
If an instance has some ui scripts customizations it could break Export to PDF of a dashboard or Export to PDF of multi-pivot reports.
Steps to Reproduce
Assumption: User who has admin right logged into a ServiceNow instance.
Pre-Conditions: The instance should support Homepage export to PDF enabled using the WHTP server.
Flow of Events:
- Create new homepage or open an existing homepage
- Export to pdf the dashboard
Post-Condition: The export shows an error and PDF is not generated
Workaround
Exporting to PDF is a process that renders the Page converts it to a PDF. The rendering part is problematic and for some cases it is found some Global UI Scripts had some issues with that.
To avoid the issue, change global UI scripts so they only run when not exporting to pdf.
To do this:
if (window.location.href.indexOf('WHTP') == -1) {
.... // add your code here
}
As an alternative to using GlideAjax, use jQuery.ajax() or plain JavaScript ajax calls.
Some customers have other customizations that could affect as well, check this Knowledge article: KB0623392 KB0623141
Related Problem: PRB1240966