COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: actcognosuser on 18 May 2016 08:55:26 AM

Title: How to Autosubmit Date prompt with Default selection
Post by: actcognosuser on 18 May 2016 08:55:26 AM
Hello All,

I am trying to default a date prompt value to current_date using the detail filter
date = #prompt('Parameter' , 'date','default'). I also have a javascript which defaults the display in the dateprompt.
The default value is selected on the calendar but not applied to the list.
The reason being date format. System date format is MON DD,YYYY. I could cast the query date to the same format . But that would be applied only after user clicks finish.

So i am trying to autosubmit the date prompt with the default selection so that the list already shows data for current date.
Then the user has the option to choose a date from the calendar.

Hope I did not make it too confusing.

Title: Re: How to Autosubmit Date prompt with Default selection
Post by: dougp on 18 May 2016 04:02:42 PM
Autosubmit is where the user clicks on a prompt and the report is automatically submitted, whether that is the same a Finish or it is to populate a downstream prompt control in a cascading scenario.  It sounds like you want the report to automatically run when it is opened and use the current date as the value for that filter.  With no user interaction at all, that's not autosubmit.

I think you want the report to autorun.  You can do this by adding to the prompt page a textbox prompt and a little JavaScript.  See attached.
Title: Re: How to Autosubmit Date prompt with Default selection
Post by: actcognosuser on 19 May 2016 07:43:49 AM
Thank you Doug.

This solution works!!