Change Field Color Based on Value Script
The Change Field Color Based on Value script can be used to set the color of a Field show on the Detail band, including related Fields. For example, you can create a Change Field Color Based on Value script that changes the Field color to orange so that Incidents with an In Progress status stand out.
Good to know:
- This script is only available for Fields in the Detail Report band. It is not available for Fields in a Detail Report (example: This script is unavailable for a Detail Report on Journals owned by a particular Incident; the script can only be run on the Detail band, meaning it can only be run for the main Incident, not the Incident's Supporting Objects).
- Added scripts can be viewed in the Scripts tab.
To add a script to a Report using the Script Wizard:
- Open a Report in the Report Designer.
- In the Action toolbar, click the Scripts button.
The Script Wizard opens.
- Select the script, and then click Next.
The Change Field Color Based on Value properties window opens.
- Define the following properties:
- Band: The band of the Report housing the Field to run the script on (example: Detail_band is the default Detail band available for this script).
- Control name: The Field that the script runs on (example: Col4_Status is the Incident Status field).
Beneath the Control Name drop-down, the Bound Field is described according to the control selected. For example, if the control is Col4_Status, the bound Field is Incident.Status, meaning the Status field is the one that the script runs on.
- Click Add to add a Field to the Values list.
The Colors Based on Field Value window opens.
- Select an Operator for the Field:
- Empty: Finds all instances in the Report where the Field value is empty.
- Equals: Finds all instances in the Report where the Field value equals the selected value.
- Like: Finds all instances in the Report where the Field value matches the selected value and its wildcard (example: Jo% finds Joe, John, Jonathan, etc.).
- Not empty: Finds all instances in the Report where the Field value is not empty.
- Not equal: Finds all instances in the Report where the Field value does not equal the selected value.
- Not like: Finds all instances in the Report where the Field value does not match the selected value or its wildcards.
- Define the value (example: "Status" Equals "In Progress").
- Select a Text color.
- Select a Background color.
-
Select OK.
- In the Script Wizard, click Finish.