COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: KA on 11 Apr 2011 01:03:59 AM

Title: Default selection for Radio button prompt
Post by: KA on 11 Apr 2011 01:03:59 AM
Hi,

I have a radio button prompt which will display two values always from the Query.

The query will fetch only two kind of outputs like,

use value   Display value
1                   Full
3                   partial

otherwise

use value   Display value
4                   Full
2                   partial

By default the use values 1 or 2 should be selected in the radio button prompt which means if 1 and 3 are appearing in the prompt then 1 should be a default value of if 2 and 4 appearing then 2 should be a default value.

I have tried to use the Range selection in the Default selection property by giving the Minimum value 0 and Maximum value 3 but it is not working. But if i give the simple selection as 1 or 2 then it is working properly. Please help if it is possible in cognos to select 1 or 2 by default. Please let me know if it is possible using any script?
Title: Re: Default selection for Radio button prompt
Post by: PRIT AMRIT on 11 Apr 2011 01:31:58 AM
Can you have two Radio Button Prompt,

one is for, name it as '1&3'

use value   Display value
1                   Full
3                   partial

Other one is for, name it as '4&2'

use value   Display value
4                   Full
2                   partial

Create a string variable:
If ([Use Value] in (1,3))
then ('1&3')
else ('4&2')

Use a conditional block or render variable. Associate the String variable and the prompt object accordingly.
You also have to change the filter expression as per the condition.

Just a guess, not tested..

Let me know how you go with it?

Thanks
Title: Re: Default selection for Radio button prompt
Post by: KA on 12 Apr 2011 01:26:11 AM
Hi PRIT,

Thank u very much for your reply.

I used two prompts and a small code and conditional block and i got the output as i expected. Thank u very much for your idea :)
Title: Re: Default selection for Radio button prompt
Post by: PRIT AMRIT on 12 Apr 2011 01:58:58 AM
Glad to know that.

QuoteI used two prompts and a small code and conditional block and i got the output as i expected

Could you please share the code to see what it does?

Thanks
Title: Re: Default selection for Radio button prompt
Post by: ShwetalM on 12 Apr 2011 02:08:00 AM
Also...when you can specify more than one value in default selections by separating them with a comma
in your e.g...you would specify defaults as 1,2
Title: Re: Default selection for Radio button prompt
Post by: PRIT AMRIT on 12 Apr 2011 02:29:15 AM
Quotewhen you can specify more than one value in default selections by separating them with a comma
in your e.g...you would specify defaults as 1,2

You can specify only one value in default selection.