Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: Duplicate Records on Detail section Post Reply Post New Topic
Page  of 2 Next >>
Author Message
Yuval
Newbie
Newbie


Joined: 21 Apr 2011
Location: Israel
Online Status: Offline
Posts: 6
Quote Yuval Replybullet Topic: Duplicate Records on Detail section
    Posted: 21 Apr 2011 at 3:49am
Hi
 
I'm having some simple but annoying problem
The detail section shows me duplicate records
My Query returns 3 records (i'm using command) like
A 1 2
A 3 4
B 5 6
 
The grouping is done by the first field ('A' or 'B')
In the detail section there is:
GH A
A 1 2
A 1 2
A 3 4
A 3 4
 
GH B
B 5 6
B 5 6
 
Can somebody explain how to fix this issue ?
 
Thanks
Yuval.
 
IP IP Logged
zach18
Groupie
Groupie
Avatar

Joined: 08 Feb 2011
Online Status: Offline
Posts: 46
Quote zach18 Replybullet Posted: 21 Apr 2011 at 4:51am
in CR 2008, you can go to the database tab on the top and select the option "select distinct records"
Using Crystal Report 2008
www.zachtech.us
IP IP Logged
Yuval
Newbie
Newbie


Joined: 21 Apr 2011
Location: Israel
Online Status: Offline
Posts: 6
Quote Yuval Replybullet Posted: 21 Apr 2011 at 5:39am

Thanks

I didn't find this option "select distinct records"

I'm using Crystal Report Designer 2008 version 12.0.0.683

There is another option to control this ?

 

IP IP Logged
Yuval
Newbie
Newbie


Joined: 21 Apr 2011
Location: Israel
Online Status: Offline
Posts: 6
Quote Yuval Replybullet Posted: 21 Apr 2011 at 5:57am
Hi Again
 
I found the "select distinct records" , and it was checked already
So it didn't solve the problem
 
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3701
Quote hilfy Replybullet Posted: 21 Apr 2011 at 6:47am
Try adding another group on your second field, putting your data in the group header for that section and suppressing your details.
 
You're seeing duplicate data due to joins to multiple tables and somewhere in that there is more than one record which is causing your duplicates.
 
-Dell
IP IP Logged
Yuval
Newbie
Newbie


Joined: 21 Apr 2011
Location: Israel
Online Status: Offline
Posts: 6
Quote Yuval Replybullet Posted: 21 Apr 2011 at 7:50am
 
I've added another group and still the detail section shows me duplicate data

How can i check my scripts ? i run my script on some sql tool and he doesn't return me duplicate records

Can it be connected to the link of the commands?

IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3701
Quote hilfy Replybullet Posted: 21 Apr 2011 at 7:58am
Put the data in the group header, NOT the details!  Suppress the details.
 
-Dell
IP IP Logged
Yuval
Newbie
Newbie


Joined: 21 Apr 2011
Location: Israel
Online Status: Offline
Posts: 6
Quote Yuval Replybullet Posted: 24 Apr 2011 at 1:27am
Thanks a lot!
it works
 
i still didn't find out why i have duplicate records in the details section in the first place
IP IP Logged
Yuval
Newbie
Newbie


Joined: 21 Apr 2011
Location: Israel
Online Status: Offline
Posts: 6
Quote Yuval Replybullet Posted: 24 Apr 2011 at 7:31pm
Well , Another small issue that i couldn't resolve
I need to summarize one of the field in the details section ( now in the GH)
 
Do you idea how to do that ?(when i summarize the detail field it duplicate the result)
 
Thanks
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3701
Quote hilfy Replybullet Posted: 25 Apr 2011 at 5:37am
Create a formula something like this:
 
If PreviousIsNull({table.groupfield}) or {table.groupfield} <> Previous({table.groupfield}) the 1 else 0
 
You can sum this field to get a distinct count.  If you need to sum a field, replace the "1" with the field name.
 
-Dell
IP IP Logged
Page  of 2 Next >>
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.016 seconds.