Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Duplications Post Reply Post New Topic
Author Message
Dehalo212
Newbie
Newbie


Joined: 23 Dec 2008
Online Status: Offline
Posts: 3
Quote Dehalo212 Replybullet Topic: Duplications
     Posted: 09 Feb 2009 at 12:45pm
I am new to Crystal Reports and I am trying to figure out how to find duplicates within my data.  Any suggestions?  I have a cost field and a description field I would like Crystal Reports to determine that if both of these are the same within a group, to highlight the fields...
 
TIA.
IP IP Logged
despec99
Newbie
Newbie


Joined: 10 Feb 2009
Online Status: Offline
Posts: 22
Quote despec99 Replybullet Posted: 10 Feb 2009 at 5:46am
Hello,

Crystal will allow you to change the font color depending on a condition.  For example, when you place the cost and description fields on your report, right click and select "Format Field"...You'll notice a "Font Field" property (I don't have CR in front of me, so not sure if it's in it's own tab or the first tab).  There you'll see "Formula"....click on that to open and right this kind of condition for both fields (in BASIC language, rather the Crystal Report langauge):

  if cost_field = description_field then
   formula = crRed
  endif

So when the two equal, both will display in red.

Hope this helps,

David
IP IP Logged
Dehalo212
Newbie
Newbie


Joined: 23 Dec 2008
Online Status: Offline
Posts: 3
Quote Dehalo212 Replybullet Posted: 10 Feb 2009 at 6:20am
I appreciate the reply.  I should of explained better.  I don't want to compare the description and cost fields.  I want Crystal to look at a description in a group, if there is another description that is the same AND the cost of the two description lines are the same, then highlight the field/change the font.
IP IP Logged
despec99
Newbie
Newbie


Joined: 10 Feb 2009
Online Status: Offline
Posts: 22
Quote despec99 Replybullet Posted: 10 Feb 2009 at 6:30am
Originally posted by Dehalo212

I appreciate the reply.  I should of explained better.  I don't want to compare the description and cost fields.  I want Crystal to look at a description in a group, if there is another description that is the same AND the cost of the two description lines are the same, then highlight the field/change the font.


If you could provide some sample data, that would be great.

David
IP IP Logged
Handsome-Hal
Newbie
Newbie
Avatar

Joined: 06 Feb 2009
Location: United States
Online Status: Offline
Posts: 7
Quote Handsome-Hal Replybullet Posted: 10 Feb 2009 at 1:07pm

Check out the DistinctCount function in the CR Help file.  That may get you what you want.

Use that in the conditional format and if count is greater than 1 then true


Edited by Handsome-Hal - 10 Feb 2009 at 1:08pm
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 10 Feb 2009 at 2:25pm
So what I think you're saying is that these "duplicate" records may appear anywhere on the report - they won't be grouped together, correct?  If this is the case, then I don't think there is a way to do this.  If they are grouped together,  then you can use David's information about formatting the font, but use a formula like this to set the color:
 
If ({table.description} = previous({table.description}) ) and
  {table.cost} = previous({table.cost}) then Red else Black
 
-Dell
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