Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Remove Duplicate lines in crystal reports Post Reply Post New Topic
<< Prev Page  of 3 Next >>
Author Message
khyulitz10
Newbie
Newbie


Joined: 11 Aug 2011
Location: United Kingdom
Online Status: Offline
Posts: 24
Quote khyulitz10 Replybullet Posted: 15 Aug 2011 at 5:05am
Can you please tell me how did you do it because I am having the same problem..Seems like Sarah deleted her post..thank you...
IP IP Logged
Fredbi
Newbie
Newbie
Avatar

Joined: 07 Jun 2011
Location: United States
Online Status: Offline
Posts: 2
Quote Fredbi Replybullet Posted: 15 Aug 2011 at 6:23am

To suppress duplicate rows because of description variations

 

Select the field that is duplicated, use the section expert, be sure to choose “details”,insert formula in the Suppress (no drill-down) formula field (X-2)

 

Insert formula (based on the duplicated field) =previous, second field statement must be in parenthesis!

 
My sample formula
{PART_RECENT_WORK_ORD.PART_part_no}=previous({PART_RECENT_WORK_ORD.PART_part_no})
 

Save, and refresh and they are gone!

 
The action of the  formula is if the field you choose is the same as the previous row the complete row is suppressed. 
 
It took a long time to find the answer to this vexing problem, many thanks to  Sarah.
 
You can not know everything but you need to know how to find out!
IP IP Logged
otsy
Newbie
Newbie
Avatar

Joined: 16 Aug 2011
Location: United States
Online Status: Offline
Posts: 1
Quote otsy Replybullet Posted: 16 Aug 2011 at 8:03am
Sarah,
 
Do you know how to calculate Sum on the records that you suppress, but without the duplicates?
Nothing that I tried works so far... I get an error that sum can't be calculated on the formula field.
 
Thank you in advance.
IP IP Logged
sachin12
Newbie
Newbie


Joined: 31 Jan 2012
Online Status: Offline
Posts: 1
Quote sachin12 Replybullet Posted: 31 Jan 2012 at 12:02pm
Thanks for your valuable suggestions. BUT this doesn't work when page changes.
For example, I have recordset from two tables on the report as below
 
a   12    address1
            address2
            address3
b    13   add4
            add5
            add6
 
If you see above, it is one to many records which works fine with 'Supress if duplicated' option BUT when data is on two pages, it repeats the main row eg: a   12  address1
                address2
PAGE CHAGE
      a   12   address3
 
Can you please how to continue supressing this even on page change? Thanks.
IP IP Logged
tmp_man
Newbie
Newbie
Avatar

Joined: 12 Mar 2012
Location: United States
Online Status: Offline
Posts: 6
Quote tmp_man Replybullet Posted: 12 Mar 2012 at 9:19am
can someone please help??? I am in the situation like sachin12

thanks
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 12 Mar 2012 at 9:30am

previous() function is not contingent on changing of pages the way the 'suppress if duplicated' option is. You should be able to use the previous() solution to suppress the extra rows. If you are still having trouble please post some sample data and how you wan it to be displayed.

 


Edited by DBlank - 12 Mar 2012 at 9:31am
IP IP Logged
tmp_man
Newbie
Newbie
Avatar

Joined: 12 Mar 2012
Location: United States
Online Status: Offline
Posts: 6
Quote tmp_man Replybullet Posted: 12 Mar 2012 at 9:39am
ok here is my example
010019 CA DEPARTMENT OF FISH AND GAME 000270 1/11/2011 PATTY PATTY 
010019 CA DEPARTMENT OF FISH AND GAME
1/11/2011 PATTY PATTY 
010019 CA DEPARTMENT OF FISH AND GAME
1/11/2011 PATTY PATTY 
010019 CA DEPARTMENT OF FISH AND GAME
1/11/2011 PATTY PATTY 
010019 CA DEPARTMENT OF FISH AND GAME
1/11/2011 PATTY PATTY 
010019 CA DEPARTMENT OF FISH AND GAME 000519 1/11/2011 PATTY PATTY 
010019 CA DEPARTMENT OF FISH AND GAME 000023 12/21/2010 PATTY PATTY 
010019 CA DEPARTMENT OF FISH AND GAME
12/21/2010 PATTY PATTY 
010019 CA DEPARTMENT OF FISH AND GAME
12/21/2010 PATTY PATTY 
010019 CA DEPARTMENT OF FISH AND GAME
12/21/2010 PATTY PATTY 
010019 CA DEPARTMENT OF FISH AND GAME
12/21/2010 PATTY PATTY 
010019 CA DEPARTMENT OF FISH AND GAME 000208 12/21/2010 PATTY PATTY 
010019 CA DEPARTMENT OF FISH AND GAME
12/21/2010 PATTY PATTY 
010019 CA DEPARTMENT OF FISH AND GAME
12/21/2010 PATTY PATTY 
010019 CA DEPARTMENT OF FISH AND GAME
12/21/2010 PATTY PATTY 
010019 CA DEPARTMENT OF FISH AND GAME
12/21/2010 PATTY PATTY 
010019 CA DEPARTMENT OF FISH AND GAME 000347 1/19/2011 PATTY PATTY 
010019 CA DEPARTMENT OF FISH AND GAME
1/19/2011 PATTY PATTY 
010019 CA DEPARTMENT OF FISH AND GAME
1/19/2011 PATTY PATTY 
010019 CA DEPARTMENT OF FISH AND GAME
1/19/2011 PATTY PATTY 
010019 CA DEPARTMENT OF FISH AND GAME
1/19/2011 PATTY PATTY 
 

1st row is the customer number
2nd row is the customer name
3rd row is the actual order number

basically I need to have a total of 5 line based on the order number
IP IP Logged
sagecentral
Newbie
Newbie
Avatar

Joined: 26 Apr 2011
Location: United States
Online Status: Offline
Posts: 3
Quote sagecentral Replybullet Posted: 12 Mar 2012 at 9:43am
HOW TO SUPPRESS DUPLICATE LINES USING SUPPRESSION (ACCESS OR CRYSTALRPTS)

To suppress duplicate rows because of description variations

Select the field that is duplicated, use the section expert, be sure to choose “details”,insert formula in the Suppress (no drill-down) formula field (X-2)

Insert formula (based on the duplicated field) =previous, second field statement must be in parenthesis!

My sample formula
{PART_RECENT_WORK_ORD.PART_part_no}=previous({PART_RECENT_WORK_ORD.PART_part_no})

Save, and refresh and they are gone!

The action of the formula is if the field you choose is the same as the previous row the complete row is suppressed.

It took a long time to find the answer to this vexing problem, many thanks to Sarah.

http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=3660&PD=0

Nothing insures success more than a good start!
IP IP Logged
sagecentral
Newbie
Newbie
Avatar

Joined: 26 Apr 2011
Location: United States
Online Status: Offline
Posts: 3
Quote sagecentral Replybullet Posted: 12 Mar 2012 at 9:46am
and ... you may try to rearrange the order in which your data is read... follow the logic
Nothing insures success more than a good start!
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 12 Mar 2012 at 9:49am

tmp_man,

if I understand you, in your case I think you want to exclude rows where there is no order_number.
this could be handles by suppression but I think the better solution is to exclude them.
it appears that the rows are null. If that is the case...
 
 in your select expert use
NOT(isnull(table.ordernumber))
 
or in the suppression option use
isnull(table.ordernumber)


Edited by DBlank - 12 Mar 2012 at 9:50am
IP IP Logged
<< Prev Page  of 3 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.