- Select the label whose color you want to change by navigating the Outline view and selecting the appropriate report item, as shown in Figure 23-7.
Figure 23-7 Selecting a report item to modify
- Select onPrepare from the drop-down list in the script editor, as shown in Figure 23-8.
Figure 23-8 Selecting onPrepare( )
- Enter the word this, followed by a period in the onPrepare script editor, as shown in Figure 23-9.
Figure 23-9 Using the this object
- Select the getStyle( ) method from the scrollable list of properties and functions.
The onPrepare script window appears as shown in
Figure 23-10.
Figure 23-10 The onPrepare script window
- Move the cursor to the end of the line in the onPrepare script window and type a period.
The scrollable list of properties and functions of the Style element appears, as shown in
Figure 23-11.
Figure 23-11 Properties and functions of the Style element
- Select backgroundColor from the list of Style properties and functions.
The property name backgroundColor is appended to the line of JavaScript, as shown in
Figure 23-12.
Figure 23-12 Select the backgroundColor property
- Complete the line of JavaScript in the onPrepare script window by appending ="yellow", as shown in Figure 23-13.
Figure 23-13 Changing the color of an element
- Choose the Preview tab to see the effect of the onPrepare event handler script.
The label appears in the report with a yellow background, as shown in
Figure 23-14.
Figure 23-14 Preview of the color change