Author |
Message |
motoxracer400f
Newbie
Joined: 11 Sep 2007
Location: United States
Online Status: Offline
Posts: 27
|
Topic: Highlighting Every Other Line Posted: 06 May 2008 at 7:39am |
Hi, I've tried playing around with this for a while and can't figure out how to do it.
How do you stripe / highlight every other detail line of printed data with a color for easier reading like a formal document.
Thank you!!
Edited by motoxracer400f - 20 May 2008 at 6:42am
|
IP Logged |
|
TheReportGuy
Newbie
Joined: 04 Mar 2008
Online Status: Offline
Posts: 6
|
Posted: 06 May 2008 at 1:18pm |
use a mod formula for the background colour in the details section
|
IP Logged |
|
motoxracer400f
Newbie
Joined: 11 Sep 2007
Location: United States
Online Status: Offline
Posts: 27
|
Posted: 07 May 2008 at 5:43am |
What is the formula to use?
|
IP Logged |
|
BrianBischof
Admin Group
Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
|
Posted: 07 May 2008 at 10:22am |
I cover this in Tutorial 6.14 of my Encyclopedia book. You can use this formula to assign the appropriate color to a section.
If (RecordNumber Mod 2 = 0) Then crSilver Else DefaultAttribute; You can find out more about my books at
Amazon.com
or reading the Crystal
Reports eBooks online.
|
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
|
IP Logged |
|
motoxracer400f
Newbie
Joined: 11 Sep 2007
Location: United States
Online Status: Offline
Posts: 27
|
Posted: 07 May 2008 at 10:30am |
Thanks for the very fast response. I will have to check out your book.
I tried that formula and it works but the problem is that I am using a formula in the suppress field of the details section expert to remove/hide duplicates and inactive items so now it highlights random lines and not every other one.
What can I do to get it to evaluate this after the other fields are suppressed if you know what I mean?
Thanks again!
|
IP Logged |
|
BrianBischof
Admin Group
Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
|
Posted: 07 May 2008 at 12:25pm |
In that case, create a variable within the suppress fields formula which increments a counter only if the section is displayed (and make the variable Global). Then use this variable in the formula that I originally posted.
I think that should take care of you!
|
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
|
IP Logged |
|
motoxracer400f
Newbie
Joined: 11 Sep 2007
Location: United States
Online Status: Offline
Posts: 27
|
Posted: 08 May 2008 at 7:11am |
Sounds like it will work, I'm just getting syntax errors trying to get this to work. Were should I declare the variable and how do I word it in the declaration and in the formula. I'm not very good at the crystal language because I try to write it out like visual basics and things don't line up well. Can you please help me out with the formula a bit?
This is the code I am using in the suppress field:
global numbervar x;
if next({RFQ.RFQ}) = {RFQ.RFQ} then true else if {RFQ.RFQ} = "TEST" then true else false and x = x + 1
Thank you so so much, I really appreciate it!
Edited by motoxracer400f - 08 May 2008 at 7:43am
|
IP Logged |
|
Lugh
Senior Member
Joined: 14 Nov 2007
Online Status: Offline
Posts: 377
|
Posted: 08 May 2008 at 8:34am |
The syntax error is the "and" bit. It should look like: if next({RFQ.RFQ}) = {RFQ.RFQ} then true else if {RFQ.RFQ} = "TEST" then true else (false; x = x + 1;)
|
IP Logged |
|
motoxracer400f
Newbie
Joined: 11 Sep 2007
Location: United States
Online Status: Offline
Posts: 27
|
Posted: 08 May 2008 at 10:42am |
I just can't figure this darn thing out. All of the records are highlighted now. Here are the formulas I'm using:
This is what I am putting in the Suppress of the details section:
global numbervar x;
if next({RFQ.RFQ}) = {RFQ.RFQ} then true else if {RFQ.RFQ} = "TEST" then true else(false;x = x + 1;)
This is what I am putting in the Backround Color of the details section:
global numbervar x;
If (x Mod 2 = 0;) Then crSilver Else DefaultAttribute;
Edited by motoxracer400f - 08 May 2008 at 10:51am
|
IP Logged |
|
Lugh
Senior Member
Joined: 14 Nov 2007
Online Status: Offline
Posts: 377
|
Posted: 09 May 2008 at 4:43am |
Try putting a carriage return after the "false;" bit. Crystal gets cranky when you put a line end marker (the semicolon) in the middle of the line. It may be ignoring the instruction to increment x.
|
IP Logged |
|
|