Alternate Row color in Crystal Reports in ASP.Net

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.

Alternate Row color in Crystal Reports in ASP.Net
Alternate Row color in Crystal Reports in ASP.Net

Check the Background Color option checkbox and choose color in color Tab.

Alternate Row color in Crystal Reports in ASP.Net
Alternate Row color in Crystal Reports in ASP.Net

After select background color go to the Format Formula Editor.

Alternate Row color in Crystal Reports in ASP.Net
Alternate Row color in Crystal Reports in ASP.Net

if RecordNumber mod 2 = 0 then crSilver else crNoColor.

Alternate Row color in Crystal Reports in ASP.Net
Alternate Row color in Crystal Reports in ASP.Net

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.

Alternate Row color in Crystal Reports in ASP.Net
Alternate Row color in Crystal Reports in ASP.Net

 

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.

Alternate Row color in Crystal Reports in ASP.Net
Alternate Row color in Crystal Reports in ASP.Net

Leave a Reply

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