COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: sfirebaugh on 01 Jul 2009 11:35:47 AM

Title: Default dynamic prompt value
Post by: sfirebaugh on 01 Jul 2009 11:35:47 AM
Hello,

I have a month prompt that I would like set with the MAX month value by default.  Right now, the report is set with a prompt value manually in Cognos Connection.  I would this to be automated so that the MAX month is selected automatically, but the user is still able to change the prompt value to something else.

Thanks in advance.
Title: Re: Default dynamic prompt value
Post by: DustPanMan on 01 Jul 2009 01:47:25 PM
In default, try setting it to 'Max' or 'Max Month'. 
Title: Re: Default dynamic prompt value
Post by: Suraj on 01 Jul 2009 08:14:52 PM
If you are using earlier versions, there are javascript available to auto select values.
Title: Re: Default dynamic prompt value
Post by: Gopinath on 02 Jul 2009 04:02:36 AM
Sort your month prompt in descending order, and place a HTML item next to the prompt. Copy paste the following code in the HTML item

<script>
var fW = (typeof getFormWarpRequest == "function" ? getFormWarpRequest() : document.forms["formWarpRequest"]);

fW._oLstChoicesprompt_name.selectedIndex = 2;

</script>

prompt_name refers name of the prompt.
Title: Re: Default dynamic prompt value
Post by: icepick on 02 Jul 2009 05:58:39 AM
I tried the java script but it doesnt work for me..
It's an interesting idea however.. I would like to know if anyone else got it working..
Title: Re: Default dynamic prompt value
Post by: Gopinath on 02 Jul 2009 08:02:58 AM
which version of Cognos are you using?
Title: Re: Default dynamic prompt value
Post by: UseCog on 02 Jul 2009 09:38:24 AM
I have got this working with a java script in RS84 version