How to hide a column in a list, dynamically in cognos?

arunpandiyarajhen picture arunpandiyarajhen · Jan 10, 2013 · Viewed 10.4k times · Source

Actually I'm working on Cognos 10.1 . I have three prompts (Value prompt) in my report. All the prompts are optional. Based on the selections I wanna show the results. Each prompt corresponds to a column in the list. If the value is chosen in the prompt, it has to show the column. Else, it has to hide the column. We should not use conditional blocks or style variables. Please help me. Thanks in advance.

Answer

user1954055 picture user1954055 · Jan 14, 2013

Yes - Here is how i did this before. I created a prompt page that allowed the user to pick the columns they wanted on the report via check boxes(true/false). Each check box represented a unique parameter name associated with a column you later want visible or invisible.

On the report page, the default state of the list shows all the possible columns. In order to conditionally hide the columns i created a Conditional Style(one for each column) and associated that with the list column/cell. The conditional style basically says hey if my param was not chosen false then set the "box-type to none which means it will not be rendered at all.

You do have to create a conditional style for each column, but when trying to make something flexible/dynamic and easy for the user its worth it. Mine also allowed dynamic sorting/grouping(up to 3 levels) for the same set of columns)

Thanks,

Tim