If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

How to change the default time on date/time prompt

Started by thubble, 17 Dec 2007 05:31:22 PM

Previous topic - Next topic

thubble

Hi

I'm working on a report which has a prompt page that contains a date/time prompt. The name of the date/time prompt is dtpEndDate. The time for the prompt defaults to 12:00 AM, but I want it to default to 11:59:59 PM. After researching I found that the following should work - Create an HTML object on the report with the following:

<script type="text/javascript">
function init()
{
document.forms["formWarpRequest"].elements["hoursdtpEndDate"].value = 11;
document.forms["formWarpRequest"].elements["minutesdtpEndDate"].value = 59;
document.forms["formWarpRequest"].elements["secondsdtpEndDate"].value = 59;
document.forms["formWarpRequest"].elements["AMPMdtpEndDate"].value = "PM";

pickerControldtpEndDate.lostFocus();
}
</script>
<body onLoad=init()>


This does work in that the time on the prompt is now displayed as 11:59:59. However, when I run the report it still runs for 12:00 AM. Also, when I try to change the time (i.e. edit the hours, minutes or seconds number) it resets the time display to 12:00 AM. I have tried with and without the "pickerControldtpEndDate.lostFocus()". Tried running the report through both IE 7 and Firefox, same thing.

I'm using Report Studio in Cognos 8.2. Any ideas on how to fix this?

Thanks in advance.

zaith

This works in Cognos 7 (Very Simple!)

<script type="text/javascript">
timePickerdtpEndDate.setValue('11:59:59');
</script>



(I dont have Cognos 8 :()

thubble

Quote from: zaith on 18 Dec 2007 02:45:11 PM
This works in Cognos 7 (Very Simple!)

<script type="text/javascript">
timePickerdtpEndDate.setValue('11:59:59');
</script>



(I dont have Cognos 8 :()


Looks like it works in Cognos 8 too. Thanks!