I have a report grouped by the following:
Group #1 - Company
Group #2 - GLAcctNo
Group #3 - Contract
Detail - Contract lines
I am attempting to sum the Balance of each contract by GL Account, Company and Grand Total. Since these are formula fields, I am using shared variables.
The Totals for Company and Grand (report footer) are fine. However, the Total for the GLAcctNo is taking the last value in the list and adding it twice into the total.
GROUP HEADER #1 holds the reset for the total for Company
WhilePrintingRecords;
CurrencyVar EndBalSumCOID:=0
GROUP HEADER #2 holds the reset for the total for GLAcctNo
WhilePrintingRecords;
CurrencyVar EndBalSumGL:=0
DETAIL GROUP holds contract detail line information, including EndBalance of each contract line
GROUP FOOTER #3 holds the three calculation fields for EndBalance running total
WhilePrintingRecords;
CurrencyVar EndBalSumGL:=EndBalSumGL + {@EndBalance};
WhilePrintingRecords;
CurrencyVar EndBalSumCOID:=EndBalSumCOID + {@EndBalance};
WhilePrintingRecords;
CurrencyVar EndBalSumTotal:=EndBalSumTotal + {@EndBalance};
GROUP FOOTER #2 holds the sum by GLAcctNo
WhilePrintingRecords;
CurrencyVar EndBalSumGL:=EndBalSumGL + {@EndBalance};
GROUP FOOTER #1 holds the sum by Company
WhilePrintingRecords;
CurrencyVar EndBalSumCOID:=EndBalSumCOID + {@EndBalance};
REPORT FOOTER holds the Grand Total
WhilePrintingRecords;
CurrencyVar EndBalSumTotal:=EndBalSumTotal + {@EndBalance};
NOTE: I cannot use the Insert Subtotals because the EndBalance calculation is built off of subreport information.
When I run the report, I get the following example data:
GL #40000 Contract #0000000041 $41,414.13 (41,414.13 running)
Contract Total $82,828.26 (double the value)
GL #40050 Contract #0000000140 $39,405.00 (39,405.00 running)
GL #40050 Contract #0000000141 $ 2,000.00 (41,405.00 running)
Contract Total $43,405.00 (adding 2,000 in 2x)
Company Total $82,819.13 (correct)
Grand Total $82,819.13 (correct)
Please let me know if you need anything else to help.
~CS
Group #1 - Company
Group #2 - GLAcctNo
Group #3 - Contract
Detail - Contract lines
I am attempting to sum the Balance of each contract by GL Account, Company and Grand Total. Since these are formula fields, I am using shared variables.
The Totals for Company and Grand (report footer) are fine. However, the Total for the GLAcctNo is taking the last value in the list and adding it twice into the total.
GROUP HEADER #1 holds the reset for the total for Company
WhilePrintingRecords;
CurrencyVar EndBalSumCOID:=0
GROUP HEADER #2 holds the reset for the total for GLAcctNo
WhilePrintingRecords;
CurrencyVar EndBalSumGL:=0
DETAIL GROUP holds contract detail line information, including EndBalance of each contract line
GROUP FOOTER #3 holds the three calculation fields for EndBalance running total
WhilePrintingRecords;
CurrencyVar EndBalSumGL:=EndBalSumGL + {@EndBalance};
WhilePrintingRecords;
CurrencyVar EndBalSumCOID:=EndBalSumCOID + {@EndBalance};
WhilePrintingRecords;
CurrencyVar EndBalSumTotal:=EndBalSumTotal + {@EndBalance};
GROUP FOOTER #2 holds the sum by GLAcctNo
WhilePrintingRecords;
CurrencyVar EndBalSumGL:=EndBalSumGL + {@EndBalance};
GROUP FOOTER #1 holds the sum by Company
WhilePrintingRecords;
CurrencyVar EndBalSumCOID:=EndBalSumCOID + {@EndBalance};
REPORT FOOTER holds the Grand Total
WhilePrintingRecords;
CurrencyVar EndBalSumTotal:=EndBalSumTotal + {@EndBalance};
NOTE: I cannot use the Insert Subtotals because the EndBalance calculation is built off of subreport information.
When I run the report, I get the following example data:
GL #40000 Contract #0000000041 $41,414.13 (41,414.13 running)
Contract Total $82,828.26 (double the value)
GL #40050 Contract #0000000140 $39,405.00 (39,405.00 running)
GL #40050 Contract #0000000141 $ 2,000.00 (41,405.00 running)
Contract Total $43,405.00 (adding 2,000 in 2x)
Company Total $82,819.13 (correct)
Grand Total $82,819.13 (correct)
Please let me know if you need anything else to help.
~CS