|[Top] [Chapter] [Previous] [Next]|
procedure AddVar(const Name: WideString; const Title: WideString; const Description: WideString; const Group: WideString; const StartFormula: WideString; const Format: WideString; const ParStyle: WideString; Mode: Integer; const LoopFormula: WideString; const GetTextForumula: WideString; WidthTW: Integer);
This method adds a variable which can be added to the report template, just like a field. In contrast to a field a variable can only represent a number value. It is designed to keep the value between different loops of the same report group - therefore it can be used to create totals. Its value is modified by the assigned formulas "StartFormula" and "LoopFormula". The first formula is evaluated when the group the field is owned by is used first, the second formula is before each time (including the first) the group is used. This means that when the text of a group is evaluated the variables are already processed. Both the "StartFormula" and "LoopFormula" should be written as assignment to modify the value. (Exception function "add()").
Example: LoopFormula = "+=ORDERS.AMOUNT*ORDERS.PRICE".