crystalite
Technical User
I am using Crystal 8.5. I want to get a sum in my GH1 using the Cost of the first option in each group (GH2).
I have the following formulas:
// to count the options in the details
whileprintingrecords;
numbervar counter;
counter:=counter+1;
counter
// to get the cost of the first option in the details
if {@counter} = 1 then {Cost}
//reset counters in GH2 header
WhilePrintingRecords;
numbervar counter:=0;
numbervar sumcounter :=0;
//total for group (1st record) in GF2
whileprintingrecords;
numbervar sumcounter;
Here is detail data that may help explain situation better:
Feature# Option# Cost
Car (GH1)
Window (GH2)
Window a (D) 1 1 10
Window b (D) 1 2 20
Window c (D) 1 3 30
Door (GH2)
Door a (D) 2 1 5
Door b (D) 2 2 15
Door c (D) 2 3 25
Tire (GH2)
Tire b (D) 3 2 6
Tire c (D) 3 3 16
Tire d (D) 3 4 26
Brakes(GH2)
Brake p (D) 4 7 8
Brake q (D) 4 8 18
Brake r (D) 4 9 28
I would appreciate any help.
I have the following formulas:
// to count the options in the details
whileprintingrecords;
numbervar counter;
counter:=counter+1;
counter
// to get the cost of the first option in the details
if {@counter} = 1 then {Cost}
//reset counters in GH2 header
WhilePrintingRecords;
numbervar counter:=0;
numbervar sumcounter :=0;
//total for group (1st record) in GF2
whileprintingrecords;
numbervar sumcounter;
Here is detail data that may help explain situation better:
Feature# Option# Cost
Car (GH1)
Window (GH2)
Window a (D) 1 1 10
Window b (D) 1 2 20
Window c (D) 1 3 30
Door (GH2)
Door a (D) 2 1 5
Door b (D) 2 2 15
Door c (D) 2 3 25
Tire (GH2)
Tire b (D) 3 2 6
Tire c (D) 3 3 16
Tire d (D) 3 4 26
Brakes(GH2)
Brake p (D) 4 7 8
Brake q (D) 4 8 18
Brake r (D) 4 9 28
I would appreciate any help.