Group and report-level conditional formatting allows you to change how report elements appear based on aggregated values, such as group totals or report totals.
This can be used to change colors, control visibility, or highlight results when a grouped value meets a specific condition.
What Is Group and Report Level Conditional Formatting?
Conditional formatting at the group or report level uses aggregate expressions to evaluate summarized values.
For example, you can:
- Change a Label color when a group total exceeds a threshold
- Hide a Label when a grouped value does not meet a condition
- Highlight grouped results based on totals or other aggregate values
- Apply formatting based on report-wide summary values
In these scenarios, group aggregate expressions are used inside the property expression instead of relying only on the Label’s built-in summary settings.
Example Use Case
In this example, the report is grouped by EmployeeID.
The goal is to:
- Display the Label in Green when the total
Freightfor the EmployeeID group is greater than9000 - Display the Label in Red when the group total is
9000or less - Optionally hide the Label when the condition is not met
Where This Is Used
Group and report-level conditional formatting is commonly used with:
- Group Headers
- Group Footers
- Report Footer sections
- Labels displaying grouped or report-level summaries
Download Sample
Step 1: Open the Finished Reports Designer
Open or create the View, run it, and open the Finished Reports Designer.
Step 2: Group the Report
Use Group and Sort to group the report by the field you want to evaluate.
In this example, the report is grouped by:
EmployeeID
Step 3: Add the Label
Add the Label you want to format to the appropriate Group Header or Group Footer.
If the Label displays a summarized value, configure its Summary settings for the appropriate group level.
Step 4: Select the Property to Format
Select the Label and choose the property you want to control with an expression.
For example:
- Foreground Color
- Visible
Open the expression editor for the selected property.
Step 5: Add the Group Aggregate Expression
Use a group aggregate expression to evaluate the summarized value for the current group.
Foreground Color Example
Iif([][[EmployeeID] == [^.EmployeeID]].Sum([Freight]) > 9000, 'Green', 'Red')This expression:
- Evaluates the current
EmployeeIDgroup - Calculates the total
Freightfor that group - Displays the Label in Green when the total is greater than
9000 - Displays the Label in Red when the condition is not met
Visible Property Example
Iif([][[EmployeeID] == [^.EmployeeID]].Sum([Freight]) > 9000, 'True', 'False')This expression shows the Label only when the grouped Freight total is greater than 9000.
Note: The syntax
[^.FieldName]refers to the current group level field used in the condition.
Step 6: Preview the Results
Select Preview and verify the conditional formatting.
Confirm that:
- The formatting is applied to the correct group
- The aggregate value is evaluated correctly
- Colors change as expected
- Visibility rules show or hide the correct elements
Step 7: Save the Report
After confirming the results, save the Finished Report.
Comments
0 comments
Please sign in to leave a comment.