Use odd and even styles
This procedure describes the steps to create a report using odd and even styles.
- Create a new report.
-
Drop the required fields from the Field List onto the
report's Detail band.
For more information, see Report bands.
- Select the Detail band, and in the Property Grid, expand the Styles property.
-
On the drop-down list for the Even Style property, click
(New).
The xrControlStyle1 setting will be assigned to the Even Style property.
-
Expand the Even Style property, and set the
Background Color property to
Beige.
You can configure other properties in this section as required.
-
Repeat steps 3 through 5 for the Odd Style property.
That is, create a new style and set its Background Color property to Ivory.
-
If you switch to the Preview tab now, you will see the
following result.
You can observe in the figure that the created styles are applied to all of the controls that are contained in the Detail band.
-
Suppose that a different style is required for one of the fields. To accomplish
this, do the following.
- Select the required field, and in the Property Grid and expand its Styles property
- Open the drop-down list for the Style property, and click (New).
- Expand the Style property, and for the created xrControlStyle3, set the Background Color property to White.
- The style of this control has priority over the Detail band's styles. Switch to the Preview tab, and view the result.