| Reports for WinForms Task-Based Help > Reporting Task-Based Help > Formatting Reports > Adding Alternating Background Color |
To create a report with alternating background color, use the OnPrint property of the Detail section to change the BackColor property of the section. To do this, complete the following steps:
cnt = cnt + 1
if cnt mod 2 = 0 then
detail.backcolor = rgb(200,220,200)
else
detail.backcolor = rgb(255,255,255)
endif
This report illustrates the alternating background color.
Whenever a Detail section is rendered, the counter is incremented and the BackColor property of the Detail section is toggled.
![]() |
Note: For the complete report, see report "01: Alternating Background (Greenbar report)" in the CommonTasks.xml report definition file, which is available in the ComponentOne Samples folder. |