Question:
How can I print a report whose rows’ background colors are interspersed, in a zebra-like pattern?
Solution:
To do so, go to the section’s OnFormat event and insert a script to test the row’s current color. A sample script for this is presented below:
Sub OnFormat
Dim White, Color
White = CDbl( RGB(255,255,255) )
Color = CDbl( Report.Sections(“Detail”).Controls(“Field1”).BackColor )
if Color = White then
‘Gray
for i=1 to 2
Report.Sections(“Detail”).Controls(“Field”&i).BackColor = RGB(192,192,192)
next
else
‘White
for i=1 to 2
Report.Sections(“Detail”).Controls(“Field”&i).BackColor = RGB(255,255,255)
next
end if
Attached to this article is a sample application developed with E3 version 4.0 b225.