Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Formula to display repeating information Post Reply Post New Topic
Author Message
PanHR
Newbie
Newbie


Joined: 07 Mar 2011
Online Status: Offline
Posts: 17
Quote PanHR Replybullet Topic: Formula to display repeating information
     Posted: 08 Mar 2011 at 3:24am
Hi,

Can someone help me with a formula to only display information that repeats in the report. For instance if the SSN is repeating more than once in the report I want to only display those details.

Thanks,

PanHR
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 09 Mar 2011 at 3:14am
since you need to read through all the records to determine if something repeats....
 
you could try a subreport.
 
you could try grouping by the field, say ssn, and then suppress the values if the count for the group = 1
 
you could try building a couple of strings in the record selection and using the results to supress the display later on...
shared stringvar all;
shared stringvar moreThan;
local stringvar this := "|" + {table.field} + "|";
 
if instr(all, this) > 0 then
  if instr(moreThan, this) = 0 then moreThan := moreThan + this;
else
  all := all + this;
 
this will build 2 'lists', one of every entry, and one of every entry that occurred more than once.
 
later on a simple formula in suppression could be:
shared stringvar moreThan;
instr(moreThan, "|" + {table.field} + "|") = 0
 
this will supress an entry that does not exist in the string of values that occurred more than once in the data
 
 
The middle one would be the first one that I try as it should impact the report the least.
 
HTH
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