COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: rajurokz on 09 Mar 2016 07:42:28 AM

Title: Dynamic column rendering in a List
Post by: rajurokz on 09 Mar 2016 07:42:28 AM
Hi Team,

I have requirement where I want to render columns dynamically using a prompt. Please find the scenario explained in detailed below.

I have a list with 7 columns(A,B,C,D,E,F,G,), 3(A,B,C) are static and the rest are dynamic. Using a multi select value prompt, I need to render  D,E,F,G individually or together. Please help me in achieving this requirement.

Thanks,
rAJUrOKZ
Title: Re: Dynamic column rendering in a List
Post by: BigChris on 09 Mar 2016 08:11:58 AM
You're going to need to play with render variables for that. How rigid do you want to be? If you wanted to be very prescriptive, you'd need to prevent the user from being able to select D, D, D, D (in your example)...or you could assume that they select D, F, G, E or similar. I'd imagine you'd need four prompts, each of which have static choices of D, E, F, and G. The first prompt would be called pFirstColumn etc.

In your query you could then have something like case ?pFirstCol?
when 'A' then [ColumnA]
when 'B' then [ColumnB]
...
END

In your page you'd then need to have each of that calculated first column in there, with a render variable along the lines of ParamDisplayValue?pFirstCol? is not missing
That way is the user doesn't select one of the options for column 2 (for example) it won't be rendered.

Anyway, that's just rough and ready - have an experiment and see if you can come up with something...post back here if tyou cant make it work.
Title: Re: Dynamic column rendering in a List
Post by: kamalkishore.6666 on 09 Mar 2016 06:51:41 PM
With what I understood I would suggest just create a  "Value Prompt" with collection of column names. Now create "Boolean Variables" for each and every column with logic something like "Paramvalue('Prompt_name') contains D. Similarly create variables for other columns and render them. Now based on the selection the columns will be displayed.