COGNOS REPORTNET TIPS AND TRICKS
CONDITIONAL FORMATTING In this example, we will set up conditional formatting for a report showing courses outside students' first and second major. The conditional formatting will be set so that the list for second major will only be displayed if it is not null. In addition to a list, conditional formatting can be set for a column or cell using the same technique.
1. Click the "Condition Explorer" flyout so the variables pane opens.
2. Click on the Variables folder.
3. In this example, we will be using the Boolean (true or false) variable. Double click or drag the Boolean variable to the Variables pane on the right.
4. Double click or drag the query item you will use in the condition to the Expression Definition pane. In this example, we will use SECOND_MAJOR. Type in "is not null" then validate the expression.
5. Next, we'll rename the variable. Click on the Condition Explorer bar, then click on the Variables folder.
6. Click the variable you just created, which is Boolean1. In the properties pane, rename the variable. In this example, we'll rename it to Major2.
7. Go back to the report layout page. Click the list on the right which we will use to associate the new boolean variable. Then select the List ancestor.
8. While the List is still selected, click on the ellipse in the Render Variable property.
9. In the Render Variable dialog box, select the Major2 variable and click OK. Now the list on the right of the page will not be visible unless there is a second major.
10. The next step is to add conditional formatting to the header at the top of the second list so that it too will only display if there is a second major. Since the header is a table cell, and not a list, the Render Variable is not available. In this instance, we must use a Style Variable. First, unlock the paddlock on the menu bar.
11. Select the table cell (not just the field or text item) on top of the second list. Then Go to the Condition Explorer and click on the No condition.
12. The center bar will turn green. Click the ellipse in the Style Variable. Select Major2 in the Style Variable dialog box then click OK.
13. Select None for Box Type. Save and run the report.
|




























