Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: multi-condition conditional formatting Post Reply Post New Topic
Author Message
casinoreports
Newbie
Newbie
Avatar

Joined: 23 Oct 2009
Location: United States
Online Status: Offline
Posts: 4
Quote casinoreports Replybullet Topic: multi-condition conditional formatting
     Posted: 23 Oct 2009 at 7:46pm
Hello, longtime lurker here, came across an issue I haven't found addressed elsewhere.
 
I am trying to build a report that will highlight a report field when it is below a certain level conditional to another report field. My formula within the field editor background formula looks like this:
 
if {CDS_REDEMPTION.Prize_ID} = 696 and {CDS_STATDAY.PtsEarned} < 300 then crred else
if {CDS_REDEMPTION.Prize_ID} = 403 and {CDS_STATDAY.PtsEarned} < 200 then crred else
if {CDS_REDEMPTION.Prize_ID} = 418 and {CDS_STATDAY.PtsEarned} < 200 then crred
 
It appears that this formula is working fine except that it is making the background of the Points Earned field for each row that doesn't meet the critera black, obscuring the text. This isnt necessarily a big deal and I probably could just make the text a lighter color but I would prefer it to not change the background of those fields that are above the point threshold.
 
I have tried adding crNoColor after the else statement but I can't figure out what to put after that in order to get the formula to work as a whole without an error in recognizing the 'remaining text' or needing a boolean after it.
 
Any help is greatly appreciated, thanks.


Edited by casinoreports - 23 Oct 2009 at 7:48pm
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 24 Oct 2009 at 8:41pm
You have it... it does not need anything added other than else crnocolor.
 
if {CDS_REDEMPTION.Prize_ID} = 696 and {CDS_STATDAY.PtsEarned} < 300 then crred else
if {CDS_REDEMPTION.Prize_ID} = 403 and {CDS_STATDAY.PtsEarned} < 200 then crred else
if {CDS_REDEMPTION.Prize_ID} = 418 and {CDS_STATDAY.PtsEarned} < 200 then crred else CrNoColor
IP IP Logged
casinoreports
Newbie
Newbie
Avatar

Joined: 23 Oct 2009
Location: United States
Online Status: Offline
Posts: 4
Quote casinoreports Replybullet Posted: 24 Oct 2009 at 9:40pm

thank you very much! i knew it was something trivial like that that i just couldnt put my finger on. i had used the nocolor before but i had it on each statement so i ended up having 3 nocolors and it had an error issue with that.

 
one other thing, is it possible to suppres individual detail rows if that data has a field with a date in it? only a small percentage of the individual records have a voided date in them and i want a suppression formula that looks something like 'if {field} contains mm/dd/yyyy then suppress'?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 25 Oct 2009 at 3:51pm
Likely you can do this suppression however I am not sure I understand the data in order to help you with the formula.
Is this field a text field might have a date in it somehwere in a string, or is it a date field that you exclude the row if it is not NULL or or a text field that only starts with a date if you want it excluded or something else?
Basically, what is the field type and what is some sample data for inclusion AND exclusion of that row.
IP IP Logged
casinoreports
Newbie
Newbie
Avatar

Joined: 23 Oct 2009
Location: United States
Online Status: Offline
Posts: 4
Quote casinoreports Replybullet Posted: 27 Oct 2009 at 12:07pm
what im looking at is:
 
group 1 on account id: detail fields = account #, name, prize id (one of three, three-digit options), points earned, settle date, void date
 
there are potentially multiple records per group depending on the settle date of the prize id, and sometimes there is also a void date. the void date is a standard date field. what i was hoping to do is suppress those records that contain a date (the not null i would assume) because they are adding unnecessary records and throwing off the total.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 27 Oct 2009 at 12:22pm
to suppress date records where there is data do:
NOT (isnull({table.datefield}))
 
Note that suppressing an item does NOT exclude it from Sums, Totals, counts, etc. To do this you have to:
1. exclude the data in the record select alltogether
2. or use a formual field with a variable tha conditionally includes rows(many peopels preferred method) or
3. use a Running Total that conditionally includes rows (my preferred method).
IP IP Logged
casinoreports
Newbie
Newbie
Avatar

Joined: 23 Oct 2009
Location: United States
Online Status: Offline
Posts: 4
Quote casinoreports Replybullet Posted: 27 Oct 2009 at 12:52pm

i feel like im still new to crystal and learning things with every report but you are helping a ton DB. i will continue messing around with this report trying different things, i greatly appreciate the help!

IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 27 Oct 2009 at 12:58pm
No prob. glad it is helping.
For a Running Total (RT) here is a sample for summing the points earned per account id (group 1)
Create a RT as "AccountPoints" (or whatever you want)
Field to Summarize = accounts points field
Type of Summary= SUM (assuming this is a number field)
Evaluate = Use a formula .. in the formula box use...
NOT (isnull({table.datefield}))
Reset=On change of Group (select group1 here)
 
Place this on the GF1.
 
Running Totals do not work on headers. They act like a while reading records and need to be on or below the level of all of the fields that they are evaluating.


Edited by DBlank - 27 Oct 2009 at 1:00pm
IP IP Logged
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