Skip to content

Clr_SubTotal - cWinReport2

Zeroes the subtotal accumulator for the passed iCounter

Type: Procedure

Parameters

Parameter Type Description
iCounter Integer A developer defined subtotal index

Syntax

Procedure Clr_SubTotal Integer iCounter

Call Example

Send Clr_SubTotal iCounter

Description

The Clr_subtotal procedure zeroes the subtotal accumulator for the passed iCounter. The value for iCounter should be assigned by the developer. In a complex report, you may choose to name the iCounter values you wish to use with mnemonics that identify the columns or fields being subtotalled.

Procedure SubTotal1 // order total
    Number nAmount

    Get Sum_SubTotal 1 to nAmount // get total but do not clear it
    Send Clr_SubTotal 1 // clear the accumulator

    DFFont "Arial"
    DFFontSize 8
    DFBeginHeader DFSubTotal 1
        DFHEADERPOS HDR_LEFT
        DFHEADERFRAME HDR_Margins 0.01 rgb_dGrey rgb_Grey
        DFWritePos   "Running Total:"  12.00  (FONT_BOLD+RGB_DBLUE+FONT_RIGHT)
        DFWritelnPos nAmount         14.1   (FONT_RIGHT) 2
    DFEndHeader

End_Procedure

Note that the above example could have used SubTotal to return the total and zero the accumulator in a single step.

See Also

SubTotal | Sum_SubTotal | Add_SubTotal | Clr_AllSubtotals