Skip to content

SubTotal - cWinReport2

Returns the appropriate subtotal and clears the subtotal accumulator

Type: Function
Return Data Type: Number

Parameters

Parameter Type Description
iTotal Integer the subtotal accumulator level

Syntax

Function SubTotal Integer iTotal Returns Number

Call Example

Get SubTotal iTotal to NumberVariable

Description

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

Procedure SubTotal1 // order total
    Number nAmount

    Get SubTotal 1 to nAmount
    Send Add_SubTotal 2 nAmount // subtotal 2 is customer total

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

End_Procedure

See Also

Add_SubTotal | Sum_SubTotal | Clr_SubTotal | Clr_AllSubtotals

Return Value

Returns the appropriate subtotal and clears the subtotal accumulator