Skip to Content
author's profile photo Former Member
Former Member

Highlight of Alternative Rows in Different Color

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.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Aug 08, 2008 at 08:40 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 11, 2008 at 02:55 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.