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

Default date prompt (last month)

Started by 4eversonic, 04 Oct 2013 07:45:08 AM

Previous topic - Next topic

4eversonic

Hello!

I have a requirement to force a date prompt in Report Studio to default to the last day of the prior month. Looking at some search results on Google, it appears I have to inssert an HTML script next to the prompt, but I can't seem to get any of the examples to work. Has anyone been successful with this?

Thanks!

4eversonic

Hi everyone,

I found some Java script that seems to work. After adding the date prompt to the prompt page, you'll need to add an HTML item right next to it and add the following script:

<script language="javascript">
//Default date contains current month/year, so set day = 1
var dDate = new Date();
dDate.setDate(1);
//This goes back to last day of previous month
dDate.setDate(dDate.getDate()- 1);
pickerControlEndDate.setValue(getFormatDate(dDate, 0 , 'YMD'));
</script>

From there, you'll need to rename the prompt to EndDate. Seesm to work for me.

Thanks!