Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Removing duplicating records in crystal reports 1

Status
Not open for further replies.

bond24

Programmer
Joined
Jan 9, 2008
Messages
24
Location
US
hi guys,

i need some help regarding how to remove duplicate records in crystal reports

my report looks like:
year description
2006 check
2007 pending
2006 check
2007 pending
2006 check
2007 pending

i am printing this report in PDF.

i used supress if duplicated , it doesnt work, then i check online then i write forumla like @concat= ToText({year}) + description, then i went into details -> Format Section -> Suppress--> X+2 -> @concat = previous({@concat})

Then also it didnt work. IS there any other way to remove duplicates. I am using C#.net(1.1), I am wasting my time on this for past two days ,Eagerly waiting for reply.

Thank you



 
Add a record sort (report->sort records) on year and then on description. Then format each field to "suppress if duplicated".

-LB
 
thank you sir ! its working now
 
Hi
i have one more questioin

Year Description
2007 Check
2006 Pending
2005 Pending
2007 Check
2006 Pending
2005 Pending
2007 Check
2006 Pending
2005 Pending

so when i do the procedure , what 'lbass' have mentioned earlier
its showing some thing like this
Year Description
2007 check
2006 pending
2005
2007 check
2006 pending
2005
2007 check
2006 pending
2005

i missing value 'pending' corresponding to year 2005.

is there any way i can make sort correctly.

Thank you





 
You can concatenate the values and then use suppress if duplicated. Leave the sort as is.

-LB
 
First of all, please be aware that suppress duplicate against a table field will only suppress that particular field when it encounters the same value on the next record.

If you want to suppress duplicate records, then make sure you have the select distinct records checked.

Your data has changed

with the orginal data, lbass suggestion would produce the following sort results

2006 check
2006 check
2006 check
2007 pending
2007 pending
2007 pending

and result in the following if you did a suppress duplicate on both year and description

2006 check
(2nd record suppressed)
(3rd record suppressed)
2007 pending
(2nd record suppressed)
(3rd record suppressed)

For your 2nd set of data, the sort would result in

2005 Pending
2005 Pending
2005 Pending
2006 Pending
2006 Pending
2006 Pending
2007 Check
2007 Check
2007 Check

Applying the suppress duplicates to both fields would result in

2005 Pending
(2nd record suppressed)
(3rd record suppressed)
2006 (Description only suppressed)
(2nd record suppressed)
(3rd record suppressed)
2007 Check
(2nd record suppressed)
(3rd record suppressed)

Is this what you want?

 
Correction!!!!

The records are not suppressed, just the duplicate field values. You will still show a line for each record.
 
Thank yu all ! I got it
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top