It is recommended to fill the rows with a different color to improve the appearance of the report and make it easier to work with the rows. This makes the report look nicer. There are two ways to do such fill in the report generator. 1. Use a highlight condition. 2. Use special properties of databand style.
The first method - using the data band's highlight condition. Open a report that contains a list. An example is shown below.
All rows have the same background color. Add a highlight condition to the data band. The band's Conditions property is used for this. Add a new condition in the editor, change the background color to another color to fill odd rows, change the text color (red by default) and set the highlight condition. The line system variable is used to specify whether this line is odd or even. for example:
C#:
(Line & 1) == 1
VB.NET
(Line And 1) = 1
I i.e. for odd rows, this condition is true. The image below shows the condition editor.
After adding conditions to the data band, the report looks like the following image.
Second way - using style properties. Data-bands have two special properties: OddStyle and EvenStyle. Specifying a style with one of these properties is sufficient to add a highlighting condition to a row. For example, the collection of styles has OddStyle. Select this style with the OddStyle property.
The report looks the same as when the first method was used.