Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: How to supress duplicates Post Reply Post New Topic
Author Message
vijaykbk
Newbie
Newbie


Joined: 07 Oct 2008
Online Status: Offline
Posts: 1
Quote vijaykbk Replybullet Topic: How to supress duplicates
    Posted: 07 Oct 2008 at 6:47pm
Hi, I getting duplicate rows while developing a report. i am using single table only.
Ex:                                                           Expected:
 ID      Name                                 ID               Name
 01      AAA                                    01              AAA
 02      BBB                                     02             BBB
 01      AAA                                     03             CCC
 03      CCC
 02      BBB
 
In this case how to remove the duplicates, and when i count the rows  it will show only 3,
 
Can you help me how to do this
 
Thanks in Advance
 
Vijay
 
 
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 08 Oct 2008 at 10:05am
Crystal Reports has a function called PreviousValue() that you can use in the Suppress property to suppress the section when the current value is equal to the previous value. Using your own field name, put this in the Suppress property.
 
{table.fieldname} = PreviousValue({table.fieldname});
 
I have the all the Crystal functions documented with sample code in my Encyclopedia books. You can find out more about my books at Amazon.com or reading the Crystal Reports eBooks online.
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 08 Oct 2008 at 10:06am
Oh yeah - for this to work you need to group by ID so that they are ordered next to each other. Otherwise, the PreviousValue() function won't ever have a match.
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
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.047 seconds.