Manipulating the Date Time control
There is a report that allows users to filter on Shipment Date Time using the Date Time control. By default, Cognos selects the current date and midnight as the date and time.
Report Studio allows you to override this with another static default value. However, a business will usually run the report for the end of the previous business day (5 pm).
In this recipe, we will learn how to change the default date and time for a Date Time control to the end of the previous business day.
Getting ready
Create a dummy report that shows sales quantity by shipment day. Define a filter on shipment day.
How to do it...
In this recipe, we want to change the default date and time for a Date Time control to the end of the previous business day using JavaScript. To do this, perform the following steps:
We will start by adding a Date Time control to the report. For that, add a new prompt page.
From Toolbox, drag Date & Time Prompt onto the prompt page. Connect it to the Shipment...