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
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?