Print Page | Close Window

Suppress duplicates or more records in report

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=11435
Printed Date: 02 May 2024 at 2:55am


Topic: Suppress duplicates or more records in report
Posted By: kanchan
Subject: Suppress duplicates or more records in report
Date Posted: 17 Oct 2010 at 11:47pm
Hi ,

I am getting the data in my report like this-

5262125371767 6 04/29/2009 COX/GEM Las Vegas Tucson
5262125371767 3 04/27/2009 COX/GEM Tucson Los Angeles
5262125371767 5 04/29/2009 COX/GEM Seattle Taco Las Vegas
5262125371767 4 04/27/2009 COX/GEM Los Angeles Seattle Taco
5262125371767 6 04/29/2009 COX/GEM Las Vegas Tucson
5262125371767 3 04/27/2009 COX/GEM Tucson Los Angeles
5262125371767 5 04/29/2009 COX/GEM Seattle Taco Las Vegas
5262125371767 4 04/27/2009 COX/GEM Los Angeles Seattle Taco
5262125371767 6 04/29/2009 COX/GEM Las Vegas Tucson
5262125371767 3 04/27/2009 COX/GEM Tucson Los Angeles
5262125371767 5 04/29/2009 COX/GEM Seattle Taco Las Vegas
5262125371767 4 04/27/2009 COX/GEM Los Angeles Seattle Taco

i am using previous function to remove the suppress duplicate records but that isnot working because records are not sorted and i can't apply the sort at report level also.please suggest me how can i read all the duplicate records and mark them as duplicate.

Thanks for your help.


-------------
kan



Replies:
Posted By: lockwelle
Date Posted: 18 Oct 2010 at 3:15am
one way would be to create a global string variable, and in each detail line, search if the value is already in the string, if it is, it is a duplicate, if not display it AND add it to the string, with a delimiter to help with uniqueness.
 
HTH


Posted By: kanchan
Date Posted: 18 Oct 2010 at 3:48am
Thanks for the reply,

I am bit new to this tool , Can you please describe in detail?

Thanks again!!


-------------
kan


Posted By: lockwelle
Date Posted: 18 Oct 2010 at 4:32am
this would be my approach:
 
global stringvar displayedItems;
 
if instr(displayedItems, {table.field}) = 0 then (
  displayedItems := displayedItems + "|" + {table.field} ;
 {table.field}
)
else
  "duplicate"
 
There are lots of things that can be done, but not knowing too much about the database and the exact requirements of the report, this is an 'outline' to demonstrate the functionality.
 
This would be placed in a formula and the formula would most likely be placed in the Detail Section of the report.
 
HTH



Print Page | Close Window