Dear all,
I have a report with date prompt from SAP BW. In prompt page i set the default value using javascript (http://www.ibm.com/developerworks/library/ba-pp-reporting-scripting_techniques-page634/index.html). It works great when i'm run a report from Cognos Connection.
<script type="text/javascript">
var fdf = getFormWarpRequest();
var listDateFrom = fdf.txtDatePDateFrom
var ftp = getFormWarpRequest();
function last90Days()
{
var ndays = 90;
var dtToday = new Date();
var dtlast90Days = new Date (dtToday - (86400000*(ndays)));
var strlast90Days = [dtlast90Days.getUTCFullYear(), dtlast90Days.getMonth()+1,
dtlast90Days.getDate()].join("-");
return strlast90Days;
}
pickerControlPDateFrom.setValue(last90Days() );
</script>
And now i want to schedule report using job with saving default value which are set using javascript. When i click "Override the default values" and try to set the velue for calendar prompt, i see as default value is today (22.01.2015) not value that i set using javascript.
When run the job without setting default values, calendar prompt also has the current date.
Is it Possible to save value that set using javascript?
Thanks. Egor.
Maybe anyone knows about using javascript in 'Jobs'?
I found a solution here http://cognospaul.com/2011/07/12/javascript-stopped-working-in-cognos-portal/,
Thanks, to Paul!!
Hello - i am an amature developer trying my hands on Java script in Cognos. Can you send me the solution for this issue. I am trying this code and after i select the dates and run the report, the report does show me the data for the selected dates but the values in the prompt come back to the current date minus 90 and does not remain the same what i selected.