Crystal Reports rows in group with alternating colors

Posted on 2005-04-27
Last Modified: 2008-01-09
I have a Crystal Report that has the following:

Group #1 Header Test1
   Group #2  Header Test2
       Group #3  Header Test3   Sum(A)           Sum(B)          Sum(C)
Details (suppressed)
   Group #2 Footer Grand Total    Sum(A)    Sum(B)    Sum(C)
Group #1 Footer Grand Total       Sum(A)    Sum(B)    Sum(C)

Go to Section Expert for Group #3 Header then to Color tab and click on Formula button and add:

if recordnumber mod 2 = 0 then

*** This works fine if the data was in a Details section since the recordnumber is in order .... but since its a Group Header the recordnumbers are all over that place because the grouping is doen after.

Question is how do I make alternating colors in the Group #3 section. What formula could I use to get the recordnumber after the grouping has occurred.
Question by:bboo
    LVL 2

    Expert Comment

    The only way I have found to do what you are asking is to use a shared variable (a variable you store and fetch if you are using and earlier version of Crystal Reports.)

    Which version of Crystal Reports are you using?
    LVL 2

    Accepted Solution

    In Crystal 10, you go into each section you want to alternate color lines and add this code to the color formula:

    Shared BooleanVar Tint;

    Tint := NOT Tint;

    if Tint = TRUE then

    If you are using an earlier version of Crystal Reports, you would do the same thing except you would have to store youre variable and then fetch it.

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    Safe way to use a password in a bat or cmd file? 8 46
    matchUp  challenge 6 37
    zeroFront challenge 7 58
    canBalance challenge 34 58
    This article will show, step by step, how to integrate R code into a R Sweave document
    A short article about a problem I had getting the GPS LocationListener working.
    Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now