Report Design
 Crystal Reports Forum : Crystal Reports 9, X, XI, 2008, 2011 : Report Design
Message Icon Topic: Highlighting Every Other Line Post Reply Post New Topic
Page  of 2 Next >>
Author Message
motoxracer400f
Newbie
Newbie
Avatar

Joined: 11 Sep 2007
Location: United States
Online Status: Offline
Posts: 27
Quote motoxracer400f Replybullet 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!!Smile


Edited by motoxracer400f - 20 May 2008 at 6:42am
IP IP Logged
TheReportGuy
Newbie
Newbie


Joined: 04 Mar 2008
Online Status: Offline
Posts: 6
Quote TheReportGuy Replybullet Posted: 06 May 2008 at 1:18pm
use a mod formula for the background colour in the details section
IP IP Logged
motoxracer400f
Newbie
Newbie
Avatar

Joined: 11 Sep 2007
Location: United States
Online Status: Offline
Posts: 27
Quote motoxracer400f Replybullet Posted: 07 May 2008 at 5:43am
What is the formula to use?
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2460
Quote BrianBischof Replybullet 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 IP Logged
motoxracer400f
Newbie
Newbie
Avatar

Joined: 11 Sep 2007
Location: United States
Online Status: Offline
Posts: 27
Quote motoxracer400f Replybullet 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 IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2460
Quote BrianBischof Replybullet 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 IP Logged
motoxracer400f
Newbie
Newbie
Avatar

Joined: 11 Sep 2007
Location: United States
Online Status: Offline
Posts: 27
Quote motoxracer400f Replybullet 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 IP Logged
Lugh
Senior Member
Senior Member
Avatar

Joined: 14 Nov 2007
Online Status: Offline
Posts: 377
Quote Lugh Replybullet 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 IP Logged
motoxracer400f
Newbie
Newbie
Avatar

Joined: 11 Sep 2007
Location: United States
Online Status: Offline
Posts: 27
Quote motoxracer400f Replybullet 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 IP Logged
Lugh
Senior Member
Senior Member
Avatar

Joined: 14 Nov 2007
Online Status: Offline
Posts: 377
Quote Lugh Replybullet 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 IP Logged
Page  of 2 Next >>
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.