Row calculations can be set up to add cell values together in order to populate the resulting value into another cell in the table row. In order to do this, you must set a to run the and populate the target cell. For more information on setting , see the Adding Behaviors topics.
Example
In the example detailed below, we want to add two cells (e.g. Price and Tax) in a row together to populate another cell in the row (Total).


|
| 1. | With a form loaded in the Layout view of the , drag and drop a Table object onto the Layout . |
| 2. | Assign a name and column type to each column through the Table Properties bar. |
| 3. | On the Table Properties bar under Behaviors, click the Table Changes Field Data behavior . PerfectForms™ launches the Behavior view. |
Note: The Table Changes Field Data will be called whenever any data is changed anywhere in the table. So, when either the Price or Tax cells are edited, the behavior will be called.
| 4. | In the Behavior view under the Objects Commands section, drag and drop a Set Field command on to the behaviors canvas. This behavior will perform the calculation. |
| 5. | In the Set Field Properties bar, click Select and navigate to the field that will receive the calculated value. |

| 6. | Notice that for each table column, there is an entry for both Current Row and All rows. In general, these are used as follows. |
| • | Current row - This means that the behavior will refer to the column cell for the currently selected row in the table. |
| 7. | On the Set Field Properties bar under the Value section, choose Formula as the value. |
| 8. | Click Compose. The dialog is shown. |

| 9. | Choose the Field option and click Select. |
| 10. | Locate the first field you want to put into the calculation and click OK. |
Note: Be sure to select the field with the Current Row option, not the All Rows option.
| 11. | Click the Add Line button. |
| 12. | With the new line selected, select the Field option and click Select again to select the next field to be included in the calculation. The will now look as follows. |

| 13. | Click OK. You can save and preview your form to test the behavior. Whenever a value is entered in the fields you selected to add together, the target field should receive the calculation. |
|
Updated: 06/12/2011
Page url:
http://www.perfectforms.com/Documentation/manual/html/?fl_row_calculations.htm
PerfectForms™ -- forms software, workflow software, and business process management