Monday, July 1, 2013

Dynamically Hiding and showing Report columns in cognos report studio by parameter selection with Cognos

In order to hide or show report columns conditionly you have to use a string variable and assign the values to it then dynamically set the value of the variable according to a parameter chosen by the user.

Steps

1.Create a parameter with choices for the user to choose
2.create a string variable and add values to it same as the parameter choices
3.And write the variable expression
as
if(ParamValue('P_year'))='2011'
then
'2011'
else
'2012'
4.Then go to the properties of report column to show or hide
5.Click the render variable property value
6.choose the string variable as render varaible
7. Then select values so when variable value matches to the selected values the column  will be shown
8.Do the same for all columns to show or hide according to the parameter selected by the user