lunes, 31 de agosto de 2015

How to conditionally hide columns based on prompt selection



How to conditionally hide columns based on prompt selection
This information comes from IBM’s Cognos support page. I’ve improved on it by adding screenshots because I think that it is easier to follow the instructions if screenshots are added.
In this example, we will hide a column if values have been selected for the prompt “supplier”
1.       create the report with all the columns you want to display

 
 2. create a prompt page with static choices for selection

 
3. set the property for the prompt page for Required to be "No"

 
4. create boolean variables for each static choice created in step 2.
Double click Boolean Variable
Add condition expression in this example supplier prompt value is not null which means there is at least one supplier selected in the prompt page
Rename variable for neatness or leave name by defect

5. click on the page explorer to get back to the report list.
 
6. select the column that you want to hide and click the Select Ancestor and then click List Column to select the whole column

 
7. In the Properties Pane, under Conditional, double-click the Style Variable and select the corresponding boolean variable and click on OK
 

 
8. click on the Conditional Explorer, select the corresponding boolean variable and click on Yes, in the Properties pane, change Box Type to None
 

When you select “Yes” the background of the condition explorer tab will change color, in this example it will turn green.
When you select none, if you do not have selected “Show hidden objects” in Report Studio visual aids the column will disappear

 
9. perform steps 6 to step 8 for the rest of the columns to hide the columns you want
 
10. save and run report