Here, we basically design the crystal reports to set the alternate row color in asp.net.
For design crystal reports first create crystal reports and bind data to it, we have already learned in previous post.
Create and Bind Crystal Reports in ASP.Net C#
Open the Crystal Reports >> Details >> Selection Expert >> Color
First, Right click on the Details and choose Selection Experts property and click the color Tab.
Check the Background Color option checkbox and choose color in color Tab.
After select background color go to the Format Formula Editor.
if RecordNumber mod 2 = 0 then crSilver else crNoColor.
Save and exit formula color editor.
Now run the crystal reports and you can see the alternate row color silver and white in the details section of crystal reports.
if RecordNumber mod 2 = 0 then crSilver else crGreen.
Save and exit formula color editor.
Now run the crystal reports and you can see the alternate row color silver and Green in the details section of crystal reports.