Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Group Row Coloring 3

Status
Not open for further replies.

elead

Technical User
Apr 20, 2001
38
US
I am looking for a code snippet to alternate row colors in a group.
thanks
 
I have two groups
Accounts
Salesperson
sp1
sp2
sp3
I am doing calculations on the salespeople so ther name and the calcs consume one line in that group. I just want to alernate rowcolors on the salesperson in the group. The detail section is suppressed.

thanks much
 
Format the section and select the color tab.
Click the formula button next to the color attribute and put in a formula like:

If Remainder(GroupNumber,2) = 0
then Gray
else NoColor
Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
Go to the groupfooter format section rigth click choose format then color and try this.

if RecordNumber mod 2>0 then crYellow else crNoColor

or if you want to creat your own color then try this.

if RecordNumber mod 2>0 then Color (200,242,253)else crNoColor

200 is red, 242 is green,253 is blue this gives you a ligth blue.

You will find this fuction in x-2 function under color constants.

This works for me.
Dave

 
Neither of these work if you have more than one group ie

Group 1
Group 2
Group 3
Group 4
summary1 summary2 etc...

I am only displaying the summaries in the 4th group (and grand totals), and when you try either of the above methods it's kinda' random as to whether it's shaded or not!

Dave
 
You would have to create a running total that counts and 'evaluates' only once per Group 4. Use Insert - Running Total or Insert - Field Object - Running Total. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Superb, this worked perfectly! I just made a running total (count) on group 4 which only evaluates on change of group four and voila!

Excellent, keep up the good work.

Dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top