Sum_SubTotal - cWinReport2
Returns the value of the subtotal for the passed iTotal, but does not zero the subtotal accumulator
Type: Function
Return Data Type: Number
Parameters
| Parameter | Type | Description |
|---|---|---|
| iTotal | Integer | A developer defined subtotal index |
Syntax
Function Sum_SubTotal Integer iTotal Returns Number
Call Example
Get Sum_SubTotal iTotal to NumberVariable
Description
The Sum_subtotal function returns the value of the subtotal for the passed iTotal, but does not zero 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 Sum_SubTotal 1 to nAmount // get total but do not clear it
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
Normally you will use the SubTotal message to get sub-totals. It returns the sub-total and clears the subtotal accumulator
See Also
SubTotal | Add_SubTotal | Clr_SubTotal | Clr_AllSubtotals
Return Value
Returns the value of the subtotal for the passed iTotal