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 for Prompt

Started by sukanya, 07 Jul 2017 03:06:36 PM

Previous topic - Next topic

sukanya

Hi,
I am trying to use below JS in HTML item with cognos 11.0.6. Its not setting the default date to current date. I did made the interactivity to No.

<script language="javascript">
var dDate = new Date();
//Subtract one day
dDate.setDate(dDate.getDate());
pickerControlStartDateParam.setValue(getFormatDate(dDate, 0 , 'YMD'));
</script>

Question: When it sets default current date, does the prompt show it as prompt header value and filters the report?

Regards,
Sukanya

CognosPaul

You really should be using the prompt API for this. That picker syntax is from 8.4.

<script>
var paulScripts ={}
  , oCR = cognos.Report.getReport("_THIS_");

paulScripts.getControl = function(promptName) {
  return oCR.prompt.getControlByName(promptName);
};

paulScripts.getControl('StartDate').setValues([{'use':'2017-01-01'}]);
</script>


Date prompt controls in Cognos always default to today. Are you talking about the prompt in the filter?