COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: dbe on 25 Nov 2011 03:05:06 AM

Title: Render Report Objects based on Parameter
Post by: dbe on 25 Nov 2011 03:05:06 AM
Hi,

I have a Prompt page with a Multi-Select Checkbox list in place.
This object has about 15 different options which can be checked by the User.

The checked objects are passed upon submission of the Prompt page.

What I would like to do, is create a String Variable checking each of the passed Parameter items.
This Variable will then be used as a Render Variable to dynamically show the related Report Objects.

I'm just wondering if it's possible in the Cognos Variables to loop through the Parameter items.
For example, something like this:

FOREACH ( ParamValue('prm_test') )
        CASE ParamValue('prm_test')
             WHEN '1' THEN 'Show_A'
             WHEN '2' THEN 'Show_B'
             WHEN '3' THEN 'Show_C'
             ELSE 'Show_D'
        END
END FOREACH

Anyone can help me out?  :-\
Title: Re: Render Report Objects based on Parameter
Post by: Gopinath on 25 Nov 2011 05:18:09 AM
Try creating one Boolean variable for each of the Report objects with expression:

ParamDisplayValue('Prompt_Name') Contains 'Value'
Title: Re: Render Report Objects based on Parameter
Post by: dbe on 25 Nov 2011 07:04:38 AM
Hi Gopinath,

Nice one!
Thanks for the advice...

I feel really stupid now, not having thought about that.
It seems so obvious!  :P
Title: Re: Render Report Objects based on Parameter
Post by: cognostechie on 26 Nov 2011 04:51:12 PM
Naah ! All of us do that sometime or the other so no need to feel stupid. BTW, since you used FOREACH, are you from PROGRESS background ?  ;)