Print Page | Close Window

[CR X]delete a line as criteria

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2022
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=17370
Printed Date: 02 May 2025 at 10:02pm


Topic: [CR X]delete a line as criteria
Posted By: Atori
Subject: [CR X]delete a line as criteria
Date 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



Replies:
Posted By: lockwelle
Date 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


Posted By: Sastry
Date 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 mailto:%7b@Increment_Cost1 - {@Increment_Cost1 } > 1 then true else false // for cost1
 
If mailto:%7b@Increment_Cost12 - {@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


Posted By: Atori
Date Posted: 20 Aug 2012 at 11:56pm
Hi,

thanks, i try it



Print Page | Close Window