Using subreports within main report, need to get a subtotal for shipped quantity. Using formulas below:
1. WhilePrintingRecords;
Shared NumberVar GTotal:=0;
Put this in the main report header
2. WhilePrintingRecords;
Shared NumberVar GTotal:= GTotal + Sum ({ARJOB.SHIPQUANT}, {ARJOB.LJOB});
Put this in the subreport
3. WhilePrintingRecords;
Shared NumberVar GTotal;
GTotal
Put this in the report footer ( for the subtotal, put in the group footer)
It almost works, except something is going on with the subtotal for every customer after the 1st customer.
For instance:
I am looking at two customer's data, the first customer listed has a correct ship quantity subtotal, the next customer listed has a "running subtotal" if that makes sense.
Example:
First customer has shipped quantities of 11,001 and 11,001
which gives subtotal of 22,002 which is correct.
But the second customer has 1403,1586,and 2
which should give a total of 2,991 but it does not instead it gives a total of 24,993
which is the same total as the bottomline "Total" for the whole report
Is there a way to tweak one of the formula's to give a subtotal for each customer that shows up in the report? Do I need to tell one of the formulas to "Reset" and if so...where and how do I do this?
1. WhilePrintingRecords;
Shared NumberVar GTotal:=0;
Put this in the main report header
2. WhilePrintingRecords;
Shared NumberVar GTotal:= GTotal + Sum ({ARJOB.SHIPQUANT}, {ARJOB.LJOB});
Put this in the subreport
3. WhilePrintingRecords;
Shared NumberVar GTotal;
GTotal
Put this in the report footer ( for the subtotal, put in the group footer)
It almost works, except something is going on with the subtotal for every customer after the 1st customer.
For instance:
I am looking at two customer's data, the first customer listed has a correct ship quantity subtotal, the next customer listed has a "running subtotal" if that makes sense.
Example:
First customer has shipped quantities of 11,001 and 11,001
which gives subtotal of 22,002 which is correct.
But the second customer has 1403,1586,and 2
which should give a total of 2,991 but it does not instead it gives a total of 24,993
which is the same total as the bottomline "Total" for the whole report
Is there a way to tweak one of the formula's to give a subtotal for each customer that shows up in the report? Do I need to tell one of the formulas to "Reset" and if so...where and how do I do this?