Trouble Viewing Images? Right-click on any image and select "Open in new tab" to view a larger version. You can also zoom in using Ctrl + Mouse Wheel for easier readability.
Article Goal
Show how to dynamically change a label’s color (such as font or border color) in Finished Reports by using expressions at the property level.
What / Why – Label Color Expressions
What: Label properties such as font color, background color, and border color can be controlled using expressions that evaluate data values at runtime.
Why: This allows important values to stand out visually, making reports easier to scan and interpret. For example, highlighting discounts, exceptions, or threshold-based values improves clarity and decision-making.
Configuration Note
| Item | Details |
|---|---|
| Expression scope | Expressions are applied per property, not globally on the label. |
| Supported properties | Common properties include Foreground Color, BackColor, and Border Color. |
| Expression logic | Logical expressions (such as Iif) determine which color is applied based on conditions. |
Use Case
| Scenario | Description |
|---|---|
| Threshold alerts | Highlight values that exceed or fall below defined limits. |
| Visual emphasis | Draw attention to important metrics like discounts or variances. |
| Conditional formatting | Apply color-based rules without modifying the underlying data. |
Example: Border Color Expression
Below is an example of setting a Border Color using an expression.
Border Color Expression:
Border Color Expression Editor:
Steps to Set Label Color Using an Expression
Step 1: Select the Label
Click on the Label you want to format.
This example uses a label located in the Detail Band.
Iif((([DiscountAmount] / [TotalCost]) * 100) >= 15,'Green' ,'Red')
Step 2: Open the Expression Editor for the Property
In the Properties pane:
Locate the property you want to control (for example, Foreground Color).
Click the button to the right of the property to open the Expression Editor.
Step 3: Create the Color Expression
Create a logical expression that evaluates your condition and returns a color.
In this example:
If the discount percentage is 15% or higher, the text is green
Otherwise, the text is red
Expression:
Iif((([DiscountAmount] / [TotalCost]) * 100) >= 15, 'Green', 'Red')
Step 4: Preview the Results
Preview the report to confirm the color changes are applied correctly based on the data.
Example Output:
Article Summary
This article explains how to dynamically change label colors in Finished Reports using expressions applied at the property level. By opening the Expression Editor for properties such as Foreground Color or Border Color, you can create logical conditions that apply visual formatting based on data values. This technique is ideal for highlighting thresholds, exceptions, or key values and adds powerful visual cues without altering the underlying data.
Comments
0 comments
Please sign in to leave a comment.