Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Deleting duplicates, not suppressing them Post Reply Post New Topic
Author Message
swatts
Groupie
Groupie
Avatar

Joined: 17 Mar 2010
Online Status: Offline
Posts: 83
Quote swatts Replybullet Topic: Deleting duplicates, not suppressing them
    Posted: 15 Aug 2011 at 7:41am
I have 3 columns:
A  12  Red
A  12  Blue
A  13  Red
A  13  Blue
B  12  Red
B  12  Blue
B  13  Red

Sort of like that. I want to get rid of all the duplicates, the ones that are exactly alike all the way across. The Format-Field Common Tab suppress duplicates isn't doing this for me. Any ideas?

I have a lot of A  12  Red's, etc, but I only want to return one of each and I also need to export it into an excel spread sheet. I wouldn't think, if I could get suppress to work, it would work with suppress because, wouldn't it show up the suppressed ones in Excel?
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 15 Aug 2011 at 7:48am
I don't believe that suppressed values show in Excel...it is basically a copy of the report that you can see.  The supressed values are still used in calculations though.
 
The best that I can think of is in the Record Selection Formula, you could a value to check against to see if has already been selected.  I use a string just because I don't have to redim arrays, something like:
shared stringvar already;
local stringvar thisRec = "|"{table.field1}+"@"+{table.field2}+"^"+{table.field3}+"|";
if instr(already, thisRec) > 0 then //already accepted
  false;
else(
  already := already + thisRec;    // add so it is not accepted again.
  true;
)
 
 
HTH
 
IP IP Logged
swatts
Groupie
Groupie
Avatar

Joined: 17 Mar 2010
Online Status: Offline
Posts: 83
Quote swatts Replybullet Posted: 15 Aug 2011 at 8:09am
I am getting back "true" on everything.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 15 Aug 2011 at 8:56am
hopefully I see the issue...
local stringvar thisRec = "|"{table.field1}+"@"+{table.field2}+"^"+{table.field3}+"|";
 
should be:
local stringvar thisRec := "|"{table.field1}+"@"+{table.field2}+"^"+{table.field3}+"|";
 
it wasn't assigning a value to the variable.
 
 
IP IP Logged
soulsniper
Newbie
Newbie


Joined: 24 May 2011
Online Status: Offline
Posts: 19
Quote soulsniper Replybullet Posted: 16 Aug 2011 at 3:51am

check the select distinct records under database

IP IP Logged
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.