Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1157
  • Last Modified:

Crystal Reports rows in group with alternating colors

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
     crSilver
else
    crNoColor


*** 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.
0
bboo
Asked:
bboo
  • 2
1 Solution
 
EasyWriterCommented:
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?
0
 
EasyWriterCommented:
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
  crSilver
else
  crNoColor


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.
1

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now