can be applied to even and odd lines of the data list to make easier to view the report. In order to design report of such type you should do the following:
- Create two styles in "Style Sheet Editor". As an example, you can define lighter background for the first one and darker for the second. Set styles’ Names to “EvenLine” and “OddLine” respectively.
- Create “StyleName” binding for Detail that outputs the data. Binding script should return style name depending on the line number. In order to get current line number use TheBand.LineNumber, where TheBand is the name of band containing the Detail (this may be DataBand or GroupBand).
If CrossBand is used, set CrossBand.StyleName binding depending on CrossBand.LineNumber property.
In the figure:
- Two different styles in the style gallery.
- Binding for property Detail.StyleName
implemented in C#:
Databand1.Linenumber % 2 == 0 ?
(Don't forget to set ScriptLanguage
to CSharp in template properties).
Sample demonstrating apply of different styles to even and odd lines: styles.rst