Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Prevent duplicates Post Reply Post New Topic
Author Message
wvandervliet
Newbie
Newbie
Avatar

Joined: 15 Jul 2014
Location: Netherlands
Online Status: Offline
Posts: 1
Quote wvandervliet Replybullet Topic: Prevent duplicates
     Posted: 15 Jul 2014 at 9:28pm
Dear forum members,

I've created a report which shows Changes and their corresponding Incidents based on a link within the Change.
C = Change
IM = Incident
This correspond in the following data:

C0035717                         
          IM0429577               
          IM0429595               
                         
C0037043                         
          IM0429494               
                         
C0040098                         
          IM0429577               
          IM0429595               

I want to prevent the "duplicate" incidents numbers.
First I tried it with the following:
If PreviousIsNull({PROBSUMMARYM2.NUMBER}) or {PROBSUMMARYM2.NUMBER} <> Previous({PROBSUMMARYM2.NUMBER}) then 1 else 0

With a Group Expert I filtered out the parts where the result is 0.
In most cases it was working except for IM0429577, due to the fact that it is not in previous. Is there any way to accomplish this?
The unique identifier is the IM and C number.
Final results should be like this:
C0035717                         
          IM0429577               
          IM0429595               
                         
C0037043                         
          IM0429494               
                         
Without the Change C0040098 and IM numbers due to the fact the IM's are already linked to Change C0035717
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 23 Jul 2014 at 5:42am
what you can do is build a string that contains all the values already used and only display results if not in the string (and of course then add them to the string).

something like:
shared stringvar used;
local stringvar sh:={table.field}
if instr(used, sh) = 0 then
used := used + "|" + sh
else
sh :="";

sh

this will suppress the details, the group header is harder, since it is already printed....I am not sure how you can hide the group header...oh, how about this. Put the group header as another detail section display it for the first IM that can be shown and then conditionally suppress it after that (with a flag that says it's already displayed that would be reset in the true group header)

Hope this makes sense and helps
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