Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: [CR X]delete a line as criteria Post Reply Post New Topic
Author Message
Atori
Newbie
Newbie
Avatar

Joined: 24 Nov 2009
Location: France
Online Status: Offline
Posts: 18
Quote Atori Replybullet Topic: [CR X]delete a line as criteria
    Posted: 20 Aug 2012 at 1:51am
Hello all

I want delete a line if, for example, the delivery is already appeared in the document.

actualy :

Delivery 1234
    item aaa
        cost 1 : 10
        cost 2 : 15

Delivery 5678
    item bbb
        cost 1 : 10
        cost 2 : 15

Delivery 1234
    item ccc
    item ddd
        cost 1 : 8
        cost 2 : 12

Delivery 7777
    item eee
        cost 1 : 10
        cost 2 : 15

Delivery 8877
    item aaa
        cost 1 : 4
         cost 2 : 13


Delivery 1234
    item fff
    item ggg
        cost 1 : 8
        cost 2 : 12



I want to delete costs 1 and 2 of delivery 1234 when there is already the costs before :
the delivery 1234 apparead 3 times on my document


Delivery 1234
    item aaa
        cost 1 : 10
        cost 2 : 15

Delivery 5678
    item bbb
        cost 1 : 10
        cost 2 : 15

Delivery 1234
    item ccc
    item ddd



Delivery 7777
    item eee
        cost 1 : 10
        cost 2 : 15

Delivery 8877
    item aaa
        cost 1 : 4
         cost 2 : 13


Delivery 1234
    item fff
    item ggg



thanks for your help
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 20 Aug 2012 at 4:12am
you really can't delete a line. you can suppress the line entirely, or suppress values. Though if you do something like a Count() or Sum() they will be included.  If that is the case, you need to create your own Running Total or use Shared Variables to accomplish the correct counting/summing.
 
HTH
IP IP Logged
Sastry
Moderator
Moderator
Avatar

Joined: 16 Jul 2012
Online Status: Offline
Posts: 537
Quote Sastry Replybullet Posted: 20 Aug 2012 at 4:47am
Hi
 
Insert a Group on Delivery code so that it will show all Delivery 1234 at one place. (i.e.) one after the other.
 
Now write the following formulas :
 
@init_Cost1// Place this formula on group header
 
Whileprintingrecords;
numbervar cost1;
cost1:=0;
 
@init_Cost2  // Place this formula on group header
Whileprintingrecords;
numbervar cost2;
cost2:=0;
 
@Increment_Cost1
Whileprintingrecords; // Place this on Cost detail 1
numbervar cost1;
cost1:=cost1+1;
 
@Increment_Cost2
Whileprintingrecords; // Place this on Cost detail 2
numbervar cost2;
cost2:=cost2+1;
 
Now go in Section expart and suppress formula editor and give the following condition
 
If {@Increment_Cost1} > 1 then true else false // for cost1
 
If {@Increment_Cost12} > 1 then true else false // for cost2
 
 
This will suppress the cost 1 & 2 for all delivery codes which are displyed more than once.
 
 
Thanks,
Sastry
IP IP Logged
Atori
Newbie
Newbie
Avatar

Joined: 24 Nov 2009
Location: France
Online Status: Offline
Posts: 18
Quote Atori Replybullet Posted: 20 Aug 2012 at 11:56pm
Hi,

thanks, i try it
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.