Using CR8.5
I have a sub report on the detail line. It calculates the sum of Other_Charges based on a Bill_Number (Link from main report to sub report)
On the sub report I get the total via this formula:
//Placed in Detail B
WhilePrintingRecords;
shared numberVar OtherChargesTotal := OtherChargesTotal + {ACHARGE_TLORDER.FUNCTIONAL_AMT}
On the main report I have a couple of formulas:
//Resets the OtherChargesTotal variable which is populated via the sub report SR_OtherCharges
//Placed in G3 header
shared numbervar OtherChargesTotal := 0;
//Gets the Other Charges value from the sub report
//Placed in Detail B
WhilePrintingRecords;
shared numberVar OtherChargesTotal;
//Resets the Group 3 (TLORDER.BILL_NUMBER) Other Charges Total formula field
//Placed in G3 Header
numbervar G3_OCTotal := 0;
//Calculates the total of Other Charges for each Bill Number
//Placed in the G3 Footer.
numbervar G3_OCTotal := G3_OCTotal + {@OtherCharges}
//Resets the Group 2 (DRIVER.DRIVER_TYPE) Other Charges Total formula field
//Placed in G2 Header
numbervar G2_OCTotal := 0;
//Calculates the total of Other Charges by Driver Type
//Placed in G2 Footer
numbervar G2_OCTotal := G2_OCTotal + {@G3_OtherChargesTotal}
Data looks like this:
Sub Report On Detail Line: 52.00
@OtherCharges on Detail B: 52.00
@G3_OC_Total on G3 Footer: 52.00
Sub Report On Detail Line: 52.00
@OtherCharges on Detail B: 52.00
@G3_OC_Total on G3 Footer: 104.00
Sub Report On Detail Line: 78.00
@OtherCharges on Detail B: 78.00
@G3_OC_Total on G3 Footer: 182.00
Sub Report On Detail Line: 130.00
@OtherCharges on Detail B: 130.00
@G3_OC_Total on G3 Footer: 312.00
Sub Report On Detail Line: 83.00
@OtherCharges on Detail B: 83.00
@G3_OC_Total on G3 Footer: 395.00
To this point all seems correct.
@G2_OC_Total on G2 Footer: 478.00
This line sould be 395.00 instead of 395.00 + 83.00.
Either my formulas are in the wrong places or the reset values are. @G3_OC_Total does not appear to be reseting.
Wayne
I have a sub report on the detail line. It calculates the sum of Other_Charges based on a Bill_Number (Link from main report to sub report)
On the sub report I get the total via this formula:
//Placed in Detail B
WhilePrintingRecords;
shared numberVar OtherChargesTotal := OtherChargesTotal + {ACHARGE_TLORDER.FUNCTIONAL_AMT}
On the main report I have a couple of formulas:
//Resets the OtherChargesTotal variable which is populated via the sub report SR_OtherCharges
//Placed in G3 header
shared numbervar OtherChargesTotal := 0;
//Gets the Other Charges value from the sub report
//Placed in Detail B
WhilePrintingRecords;
shared numberVar OtherChargesTotal;
//Resets the Group 3 (TLORDER.BILL_NUMBER) Other Charges Total formula field
//Placed in G3 Header
numbervar G3_OCTotal := 0;
//Calculates the total of Other Charges for each Bill Number
//Placed in the G3 Footer.
numbervar G3_OCTotal := G3_OCTotal + {@OtherCharges}
//Resets the Group 2 (DRIVER.DRIVER_TYPE) Other Charges Total formula field
//Placed in G2 Header
numbervar G2_OCTotal := 0;
//Calculates the total of Other Charges by Driver Type
//Placed in G2 Footer
numbervar G2_OCTotal := G2_OCTotal + {@G3_OtherChargesTotal}
Data looks like this:
Sub Report On Detail Line: 52.00
@OtherCharges on Detail B: 52.00
@G3_OC_Total on G3 Footer: 52.00
Sub Report On Detail Line: 52.00
@OtherCharges on Detail B: 52.00
@G3_OC_Total on G3 Footer: 104.00
Sub Report On Detail Line: 78.00
@OtherCharges on Detail B: 78.00
@G3_OC_Total on G3 Footer: 182.00
Sub Report On Detail Line: 130.00
@OtherCharges on Detail B: 130.00
@G3_OC_Total on G3 Footer: 312.00
Sub Report On Detail Line: 83.00
@OtherCharges on Detail B: 83.00
@G3_OC_Total on G3 Footer: 395.00
To this point all seems correct.
@G2_OC_Total on G2 Footer: 478.00
This line sould be 395.00 instead of 395.00 + 83.00.
Either my formulas are in the wrong places or the reset values are. @G3_OC_Total does not appear to be reseting.
Wayne