cancel
Showing results for 
Search instead for 
Did you mean: 

Highlight of Alternative Rows in Different Color

Former Member
0 Kudos

I have a requirement where i need to alternate colors for rows. I want the rows 1,3,5, 7,9, 11 .... in one background color and 2,4,6,8,10,12,14 in a different color. Is there a way to achieve this result in Crystal Reports. Please advice.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Srinivasa,

James is correct. If you don't want to have to rely on a CustomerID or other field, you can use "RecordNumber" instead.


IF Remainder(RecordNumber, 2) = 0 THEN crNoColor ELSE crSilver

Jason

james_wong
Employee
Employee
0 Kudos

Hi Srinivasa Prabu,

You can put condition in backgroud color to display different color base on even or odd number.

1-Insert Customer ID into detail section

2-Right click Detail Section -> Section Expert -> Color tab -> click x-2 buttom -> Insert the following formula to display no color for odd number and silver for even number.

//Based on remainder for customer id, if odd display no color else silver.

iif (Remainder({Customer.Customer ID}, 2) = 0, crNoColor, crSilver)

James