AddVar Method

[Top]  [Chapter]  [Previous]  [Next]

Applies to



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".



The name of the variable


The title of the variable


The description what this variable does


The group to add to, use "*" for current.


This formula is used to assign the start value. If empty or no assignment (not =, += etc) the initial value is 0.


A string to specify the print format, use "CUR=€" use print EUROS, or "CUR=$" for Dollars.


The paragraph style to specify the character attributes.


The mode bits, to select and hide the variable.


This formula is evaluated before each loop of the group, including first. Use "+=" to sum up a value or "add( field(''), orders.price)" to add a name which can be used in a chart. (not yet implemented)


This formula is used to create the text for the field.


This value is reserved.

[idh_iwpreport_addvar.htm]    Copyright © 2007 by WPCubed GmbH