If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Use Value Prompt as a Radio Button Group !

Started by mohsin2010, 07 Jan 2011 05:22:30 AM

Previous topic - Next topic

mohsin2010

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___
 
Code:

ParamDisplayValue('P_choice')='Region'

  similar for Country
   
Code:

ParamDisplayValue('P_choice')='Country'

4) create an HTML item just beside to Choice prompt
   give the script as
Code:

     <Script>
        function my_onchange()
         {
           SetPromptControl('reprompt')
          }

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


But this code is not working ??? let me know pls HELP :(

venkiatmaruthi

Moshin

This should work. I used the same code in one of my report. What version are you working?
The above script I have sent is for Cognos 8.2. If your is also 8.2 then tell me what is the error?


Thanks.
Venkat.


MFGF

He is using Cognos Express, which is based on Cognos 8.4

MF.
Meep!

mohsin2010

thanx venkiatmaruthi ,

                    MFGG is right i m using cognos express 8.4 how do i do the same work on that ? its not working properly over there  ???    

venkiatmaruthi

Moshin,
I am working on 8.2 only.

Not sure it it works.... but try to check this out.

Change the script last line
document.forms["formWarpRequest"].elements["_oLstChoiceschoice"].onchange = my_onchange
with
getFormWarpRequest()._oLstChoicesChoice.onchange=my_onchange;

it should work. In 8.4, the usage of formWarpRquest changed a little.


Thanks.

mohsin2010

venkiatmaruthi ,

                it is not working .. . i tried it  :'(

venkiatmaruthi

It should work.

are you directly giving the script or have you changed the name of the valueprompt in the script?

getFormWarpRequest()._oLstChoicesChoice.onchange=my_onchange;

here Choice is the name of the Valueprompt where you select either Region or Country.

let me know the error.

Thanks.


mohsin2010

hi,

from the first step,

1) Create one value prompt name it as 'choice'.

from where can i change the name of the Value Prompt?? ???

mohsin2010

venkiatmaruthi,

i have named the value prompt but in spite of that it is giving error i have taken picture what i m doing in series and the output also so you can kindly tell me my mistake  :'(

Best Regards,
Syed Mohsin Raza

S2000

Hi,

If I've read the problem correctly than an alternative solution to all the Javascript could be this.

Set two promts.
The radio button prompt -  P_Choice
The Text Box Prompt  - P_Text

In the filter of the query use the following code
If (P_choice = region) then (region) else (country) = P_Text

venkiatmaruthi

Hi,
I don't know whether you are testing me or you are a fresher to cognos.

Keep HTML item immediate next to the Value prompt.

I don't whether you have given static choices or not. Give static choices as "Region" and "Country".

have to mentioned the variable script as I mentioned earlier?

See my attached screen shots. I hope you are expecting the same functionality.


Thanks.


mohsin2010

Thanks venkiatmaruthi !
                                 for your such cooperation and i m not checking you dude i m new bie thats why i m getting stuck alot but your screen shots help me out !  :)
   Thanks once again but i want two more things if you dont mind pls.. .

   * like i m getting "Region" name and "Country" name if i want to get those "Country" name and "Region" name  which i have in my table and to generate report according to them so what should i do ??

   * and the second thing is that if i want to summarize my data like i m getting record according to region and i want to summarize data according to region that how much country are there in that region like
(Region America = 2 Countries )

Best Regards,
Syed Mohsin Raza













venkiatmaruthi

Mohsin,

In fact, I am also a newbie to Cognos.... just 3 months old. I am learning the cognos by googlling on net and the help file. you will have Report studio manual. look into it. You can see that.

Sorry to say like this. I am having work.


Thanks.
Venkat.

mohsin2010

venkiatmaruthi,
 
  yup you are right i m doing that as you told me but i was thinking you would be more professional that my question are in your finger tips and would not waste your time you are 3 months old for cognos and i m just 1 month old and have learned alot from u like people and from the Google !
     the thing you want to make me understand is right but the way you chose is totally Wrong !
   
Best Regard

Syed Mohsin Raza