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 danielledunham on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Conditional Formatting based on Duplicate Values 1

Status
Not open for further replies.

ptkeft

Technical User
Joined
Feb 20, 2007
Messages
3
Location
US
Hello. I am new to the world of Crystal Reports and could really use some help!

I have a field {names} grouped by another field {status}. One particular name may occur in two or more status groups, which is fine. However, if a name has already occured in a previous status group, I need to change the color of the second occurance of the name to red.

So it might look like this:

STATUS GROUP ONE
Joe
Beth
Andre

STATUS GROUP TWO
Phil
Beth <---Should be RED

STATUS GROUP THREE
Joe <---Should be RED

I can't figure out how to use the "previous" funtion since they aren't in order...? Any ideas?

Thank you so much!
 
You should always post your CR version, as it affects what solutions are suggested.

-LB
 
Sorry.

I'm using CR XI.

My original database is in MS Access 2003.
 
Create a running total field ({#CntNames}) that is a distinct count of {names}. Place the running total in the "names" group header.

Create a formula ({@PriorCntNames}):
WhilePrintingRecords;
NumberVar PriorCntNames;
PriorCntNames:= {#CntNames}

Place {@PriorCntNames} in "names" group footer.

Create a formula ({@PriorCntNamesDisplay}):
WhilePrintingRecords;
NumberVar PriorCntNames;
PriorCntNames

Place {@PriorCntNamesDisplay} in "names" group header.

In format editor for the "names" field, conditionally color the field with the following formula:
If {#CntNames} = {@PriorCntNamesDisplay} then CrRed else CrBlack

MrBill
 
Thank you so much--I gave you a star.

You have made my day at work much better, and I hope that I can someday (when I am more experienced) repay you!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top