COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: mohsin2010 on 04 Jan 2011 03:56:13 AM

Title: How Do I Use Value Prompt As A Radio Button Group !
Post by: mohsin2010 on 04 Jan 2011 03:56:13 AM
HI ,
      i am using value prompt as a radio button group such that i want to filter the data according to our need using radio button group and there is a text box prompt as well.
    such that i have two radio button for region and country and select any one and after that i put region name or country name according to our radio button selection and filter the data .. . how can i do this :-[

Best Regards!
Title: Re: How Do I Use Value Prompt As A Radio Button Group !
Post by: venkiatmaruthi on 04 Jan 2011 04:07:34 AM
Put two value prompts and make SelectUI as Radio button group.

Then use Render variable and capture the Text box value to this and do the formatting accrodingly.


Thanks.
Title: Re: How Do I Use Value Prompt As A Radio Button Group !
Post by: mohsin2010 on 04 Jan 2011 04:19:03 AM
do you please tell me step wise for getting my goal  i am not getting it i am unable to render the variable??
Title: Re: How Do I Use Value Prompt As A Radio Button Group !
Post by: MFGF on 04 Jan 2011 05:54:03 AM
I'm not quite clear on what you're tyring to do here.  What are you using the radio buttons for?  Are you trying to set up a radio button prompt that will allow you to choose whether to filter on Region or on Country?

MF.
Title: Re: How Do I Use Value Prompt As A Radio Button Group !
Post by: venkiatmaruthi on 04 Jan 2011 06:35:32 AM
Ok.. it's bit triky as we have to use Javascript. I was thinking like it's on Main page.

Here we go__

1) Create one value prompt name it as 'choice'. The parameter for this is P_choice
2) create two radiobutton group value prompts. the parameters P_Region, P_Country
3) create boolean render variable for Region and Country prompts seperately.
   for Region.... render variable say V_Region
    script would be___
    ParamDisplayValue('P_choice')='Region'
   similar for Country
      ParamDisplayValue('P_choice')='Country'
4) create an HTML item just beside to Choice prompt
    give the script as
      <Script>
         function my_onchange()
          {
            SetPromptControl('reprompt')
           }

         document.forms["formWarpRequest"].elements["_oLstChoiceschoice"].onchange = my_onchange
      </Script>



Now run the report. It should work.

Hope this helps.

Thanks.
Title: Re: How Do I Use Value Prompt As A Radio Button Group !
Post by: mohsin2010 on 04 Jan 2011 10:21:18 PM
Thanks venkiatmaruthi,

i did as you posted but there is some error going over there what is the result when i run report i want to show you in this attachment.
Title: Re: How Do I Use Value Prompt As A Radio Button Group !
Post by: mohsin2010 on 04 Jan 2011 10:29:23 PM
HI MFGF ,

   ok i tell you what i want actually i want a Value Prompt of Radio Button Group having two radio button one for region and the other one  for country and there is a Text Box Prompt next to it where we can enter either
"Region name" or "Country name" according to our radio button selection and filter data accordingly.
Title: Re: How Do I Use Value Prompt As A Radio Button Group !
Post by: venkiatmaruthi on 05 Jan 2011 03:56:54 AM
Sorry

I can't open rar as my company policy is not allowing rar files.


Thanks.
Title: Re: How Do I Use Value Prompt As A Radio Button Group !
Post by: S2000 on 07 Jan 2011 04:18:21 AM
If I read that correctly all you really need to do is make the text box prompts optional.
Then the reports will only filter on the item that has been entered and ignore the blank prompt.

You don't need a radio button prompt to declare which of the two prompts is the active one.
Title: Re: How Do I Use Value Prompt As A Radio Button Group !
Post by: rKn on 21 Jun 2011 05:58:06 AM
Hi MF.

Please let me know whether you got solution for your query..if so please help me tooo...i m also tryin to find out a solution similiar to to your query..

thx
Renjith