Smart questions
Smart answers
Smart people
Join Tek-Tips Forums

Member Login

Remember Me
Forgot Password?
Join Us!

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.
Jobs from Indeed

Link To This Forum!

Partner Button
Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

How to alternate background color on every other lineHelpful Member!(11) 

AssetRecovery (Programmer) (OP)
17 Sep 03 17:40
I need to format some reports that have long lists of information and it would make them alot easier to read if I could format the background color to alternate everyother line like in templates.  What would a sample formula for this look like?
Helpful Member!(5)  IdoMillet (Instructor)
17 Sep 03 17:43
In the color attribute of the section format options enter something like:
IF Remainder (RecordNumber, 2) = 0 THEN crYellow ELSE crNoColor

- Ido

CUT, Visual CUT, and DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.

AssetRecovery (Programmer) (OP)
18 Sep 03 14:36
That worked great but now how would I make the font be a different color on the lines that are yellow.  I modified the formula so that I was using crTeal and it's hard to read black text on that background.  Unless there is a way for me to specify the hex equiv for a lighter shade or am I stuck with just color names like Blue, Red, Yellow?

Helpful Member!(4)  vidru (Programmer)
18 Sep 03 14:41
You can use Color() and supply the RGB values, like this:

IF Remainder (RecordNumber, 2) = 0 THEN Color (238, 238, 224)
ELSE crNoColor

mbarron (TechnicalUser)
18 Sep 03 17:16
All of the named Colors will be in the function panel under the Color Constants.

Teal is one of the named colors.  

IF Remainder (RecordNumber, 2) = 0 then teal else defaultattribute  


Cort (MIS)
1 Oct 03 9:20
Thanks fellas this used to be in a FAQ somewhere but it's disappeared.  Very Handy
Cort (MIS)
1 Oct 03 9:24
Also. If your getting multiple returns for each record and want every group to alternate colors is there a way to do that?
Cort (MIS)
1 Oct 03 9:29
Answered my own question.  Use GroupNumber instead of RecordNumber in 9.0
GJParker (Programmer)
1 Oct 03 9:31
slightly different way, but just swap RecordNumber for GroupNumber

if GroupNumber mod 2 = 0 then
    color (232,232,232)

Gary Parker
Systems Support Analyst
Manchester, England

Helpful Member!(2)  rosemaryl (MIS)
1 Oct 03 12:18
Dear NovellCRDeveloper,

Here is a tip I show in my classes:

If you have suppressed groups or details, then using groupnumber or recordnumber will not work.

Create a running total (Insert Field Object/Running Total) and choose the Group or Detail field as the case may be.  Select Count, Evaluate on Change of Record, Reset Never.

Now you have a counter field that counts the "visible" records and you would use that in the formula.

Now, to get the rgb value for any color, simply select format/font on any field, go all the way down the list to custom and then in the Custom Color Dialog select any color you want - the rgb value will display for you to note.

I find that a very light gray works really well.

Also, by changing the divisor to another number you can change the banding.

I hope the above was helpful,


Rosemary Lieberman,
Microflo provides expert consulting on MagicTSD and Crystal Reports.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Back To Forum

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close