Cautions about HTML items and JavaScript files
This recipe shows you that the HTML items and JavaScript files used on the report page are not executed when a report runs in PDF or Excel.
Getting ready
Open the report that we created in the Creating a variable width bar chart using JavaScript recipe in Chapter 3, Using JavaScript Files – Tips and Tricks.
How to do it...
Here, we will run the report in both HTML and PDF format as described in the following steps:
Run the report in HTML format. Ensure that the bar charts are generated fine.
Now re-run the report in PDF format.
Notice that bar charts are absent from the PDF output.
How it works...
When users run the report in any format other than HTML, the prompt page generated is still a web page. Therefore, any scripts put on the prompt page (for example, default selections) work fine. However, when the actual report is generated, it will execute the scripts only in HTML format. Therefore, the script actions fail in case of PDF, Excel, or any other...