Coloring Report Cells with Color RulesLast Updated: 08/12/2016 Introduced in Verision: 2.0
Cell Color Rules evaluate the report data in a cell, coloring the cell when its data meets the rule’s condition. When building a cell color rule, select a rule that has already been created, and set the color that will highlight the cell. The rule must use a column on the report as input.
For example, a rule called PNG Rule could be created that evaluates whether a document type is .png. Then, a report could be created listing all the folders in the system and all of the documents in those folders. One of the columns on that report, Document Type, could then be used as input for the PNG Rule. Then create a color rule for the report that uses the PNG Rule to evaluate the Document Type against the conditions in the rule, and highlights all of those cells that contain .png in the Document Type field.
To assign a cell color rule to a report, in the Report Designer, select the column in the workspace. In the Properties Panel, under the section Formatting > Color Rules, click the Add button.
The goal of this example is to:
- Create a rule with the condition that the Nesting Level value is 2.
- Create a report that contains a Nesting Level column.
- Add a cell color rule to the report that will highlight cells that meet the rule’s condition.
To begin, navigate to a Designer Folder and select the Create Rule button.
Give the rule a Name.
Then, from the Behavior drop-down list pick Form Rules. Click Create to open Rule Designer.
The rule will evaluate the condition Nesting Level = 2. To begin building the rule, first set the type of data the rule will evaluate. The rule will be checking an integer value (2).
In the Properties Panel, in the Flow Data section, click the Add button.
Enter a name for the input in the Name field, and click the Type selector.
In the resulting pop-up window, select the type Int32 and click Ok.
Back in the Edit Object pop-up window, click Ok to save this input type.
Next, add a condition to the rule.
In the Text Rule View tab, click the plus sign and select Add Condition.
Begin by selecting the flow data input type just created, Nesting Level [Int32], and clicking Next.
Expand the Equals category and select the operator Is then click Next.
Finally, enter “2” in the Value field and click Done.
Click Close to close Rule Step Editor.
This completes the rule. Save it and close the Rule Designer.
The next step is to build the report with the data that the cell color rule will evaluate.
Click the Create Report button, and select Create Report.
Give the new report a name and click Ok to open it in the Report Designer.
First, add a data source to the report.
In the Toolbox Panel, under the category Data Sources > Common, drag a Folder data Source to the Sources list.
Then add columns to the report.
From the Folder Data Sources category, drag an Entity Name, Folder Type Name, and Nesting Level to the workspace.
Then, associate the report with the cell color rule.
In the Properties Panel, under the Colors section, select the Use Row Coloring checkbox. Without checking this box, colors will not display on the report.
The goal is to configure the cell color rule to highlight only cells, not an entire row. To do this select the column header for Nesting Level.
In the Properties Panel, in the Settings section, the Title field displays Nesting Level, indicating the selection of this column to assign the cell color rule.
Under the section Formatting > Color Rules, click the Add button.
In the resulting pop-up window, in the Rule drop down list, select the previously created rule that evaluates if Nesting Level data is equal to 2.
This rule was created to use Nesting Level data as an input, so when the rule is selected, Nesting Level appears in the Rule Inputs box. Now set the field on the report for the rule to evaluate.
Select the Nesting Level input, and click Edit.
Select the column value to use as the rule’s input in the Report Field drop down list, then click Ok.
Now that the connection is made between the field on the report and the rule that will evaluate it, the next step is to define the cell color for those cells that meet the rule’s condition (“Nesting Level = 2”).
Click the Background selector.
In the Color Picker pop-up window, select the color and click Ok.
The foreground and selected colors can be set as well, but the color rule is complete. Click Ok.
The report is now complete. Save it and close the Report Designer.
To view the report, select the newly created report’s thumbnail and select Run Report from its Action menu.
The report displays cells where the Nesting Level value satisfies the rule as colored. The other cells are not colored.