KB-55180: Interspersing the background color of a report’s rows.

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.

Attachments:

Sample

Print Friendly, PDF & Email

Este artigo foi útil? Was this helpful?

Classificação média - Average rating 0 / 5. Count: 0

Leave a Reply

Your email address will not be published.Required fields are marked *