Controlling JavaScript file execution
In Chapter 3, Using JavaScript Files – Tips and Tricks, we saw many recipes to manipulate the prompts. However, it is to be noted that JavaScript files are executed every time the page loads. Hence, it is important to control the execution of certain scripts.
This recipe will show you why controlling the JavaScript file execution is necessary in certain cases and how to do it.
Getting ready
We will use the report created in the Defining dynamic default values for prompts recipe of Chapter 3, Using JavaScript File – Tips and Tricks for this one.
How to do it...
In this recipe we will have a look at how we can control the JavaScript execution by doing a simple modification to the original script. To do this, perform the following steps:
Open the report in IBM Cognos Report Studio and save it with a different name because we are going to change it.
Run the report to see what it is doing. We have already written the JavaScript in this report to default the date...