Taming the JavaScripts
In the 'Tips and Tricks – JavaScripts' chapter, we saw many recipes to manipulate the prompts. However, it is to be noted that JavaScripts are executed every time the page loads. Hence, it is important to control the execution of certain scripts.
This recipe will show you why taming the JavaScripts is necessary in certain cases, and how to do it.
Getting ready
We will use the report created in 'Dynamic default value for prompt' recipe (Chapter 3) for this one.
How to do it...
Open the report in 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 to second entry from top, where dates are sorted from recent to old. Hence, it defaults to
200711
as per the data available in sample database.Change the date to
200712
and run the report.Once the report is rendered, hit the RUN button to re-run the report.
Notice that the date prompt...