Specifies expression(s), calculated before outputting an object. This allows to calculate global report variables and to dynamically change the following object properties right before outputting:
LEFT - left offset of the object in pixels (integer)
TOP - top offset of the object in pixels (integer)
WIDTH - object width in pixels (integer)
HEIGHT - object height in pixels (integer)
VISIBLE - specifies whether the object appears when printing (boolean)
Rules for the expression are similar to standard report expressions; result of the expression must be assigned to attribute from the list above, or to global variable. Several expressions are allowed. Every expression must end with a semicolon (;). Generally, each expression must be written in the following format: OBJECT_ATTRIBUTE := EXPRESSION;
Example of typical On Print code:
LEFT := LEFT + ( WIDTH + 1 ) * ( GROUPRECORDNUMBER - 1 ); //Changing left offset of the current object
WIDTH := 150; //Changing width of the current object
VARIABLES.VAR2 := VARIABLES.VAR2 + 1; //Incrementing a global report variable
The following example shows how to place DBText objects of Data band in each group not vertically, but horizontally with offset (transpose the table):
1. Specify On Print action for objects in the group (RDBText1):
LEFT := LEFT + ( WIDTH + 1 ) * ( GROUPRECORDNUMBER - 1 );
2. Set Data band height to 0.
3. If there is another band after the Data band, it should be stretched, and objects of that band should be dragged down to prevent their intersection with RDBText1 object.