You can use expressions in Finished Reports to dynamically change a Label’s appearance based on report data.
This is useful for highlighting thresholds, exceptions, or other values that need additional visual emphasis.
What Can Be Controlled with Expressions?
Expressions can be applied to individual Label properties.
Common examples include:
- Foreground Color
- BackColor
- Border Color
Each property is configured separately in the Properties pane.
For example, you can change a Label to green when a value meets a condition and red when it does not.
Example Use Cases
Property-level expressions can be useful for:
- Highlighting values above or below a threshold
- Drawing attention to exceptions
- Emphasizing discounts or variances
- Applying color-based formatting without changing the underlying data
Example: Border Color Expression
A Border Color can also be controlled using an expression.
Step 1: Select the Label
Select the Label you want to format.
In this example, the Label is located in the Detail band.
Step 2: Open the Expression Editor for the Property
In the Properties pane:
- Locate the property you want to control, such as Foreground Color.
- Open the Expression Editor for that property.
Step 3: Create the Color Expression
Create an expression that evaluates the report data and returns the appropriate color.
In this example:
- If the discount percentage is 15% or higher, the Label appears Green.
- Otherwise, the Label appears Red.
Use:
Iif((([DiscountAmount] / [TotalCost]) * 100) >= 15, 'Green', 'Red')This expression compares DiscountAmount to TotalCost and applies the color based on the calculated percentage.
Step 4: Preview the Results
Select Preview and verify that the color changes are applied correctly.
Confirm that:
- Labels meeting the condition use the expected color
- Labels that do not meet the condition use the alternate color
- The expression is evaluating the correct fields
Step 5: Save the Report
After confirming the conditional formatting, save the Finished Report.
Comments
0 comments
Please sign in to leave a comment.