This tutorial describes the steps to create a report using odd and even styles. For more information on using styles in the Report Designer, refer to Understand Styles Concepts.
To utilize odd and even styles, follow the steps below.
- Create a new report.
- Bind the report to a data source.
-
Drop the required fields from the Field Listonto the report's Detail band.
-
Select the Detail band, and in the Property Grid, expand the Stylesproperty.
Invoke the drop-down list for the Even Styleproperty, and click (New).
The xrControlStyle1will be assigned to the Even Styleproperty.
-
Now, expand the Even Styleproperty, and set the Background Colorproperty to Beige(or any other of the properties available in this section as required).
-
Repeat steps 4-5 for the Odd Styleproperty: i.e. create a new style and set its Background Colorproperty to Ivory.
-
If you switch to the Preview Tabat this stage, you'll see the following result.
As you can see, the created styles are applied to all the controls contained in the Detail band.
-
Suppose 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, expand its Stylesproperty and open the drop-down list for the Styleproperty. Click (New).
Then, expand the Styleproperty, and for the created xrControlStyle3, set the Background Colorproperty to White.
-
The style of this control has priority over the Detail band's styles. Switch to the Preview Tab, and view the result.
See Also