TotalAggregate properties are used to specify an aggregate function which applies to a column in Table or TreeTable, or pass a value from a 4GL routine. The result of the function execution will be displayed to the automatically added row at the bottom of the table column.
in Lycia Form Designer |
Form XML code:
A Table column with Total Aggregate properties:
<TableColumn text="column" visible="true" identifier="tc_f8" totalAggregate="true" totalAggregateType="Avg" totalAggregateText="Average:">
<!-- child element -->
<GridLength gridLengthType="Auto"/>
</TableColumn>
Possible values:
Sum
Program
Avg
Min
Max
Count
Default value:
Sum
Associated containers:
Associated 4gl syntax:
Influence and behavior:
To apply an aggregate function to a column, follow these steps:
Set the TotalAggregate property to True
Set the TotalAggregateText property. It specifies the string which is displayed before the result. For example, "Total: " for the Sum aggregate function.
Set the TotalAggregateType property. It specifies the aggregate function which applies to the column. The possible values are:
Sum (Displays the total of the group values) (Default value)
Avg (Displays the average of the group values)
Min (Displays the minimum of the group values)
Max (Displays the maximum of the group values)
Count (Displays the number of the group entries)
Program (Displays the value passed from the 4GL routine)
Set the TotalAggregateName property if TotalAggregateType is set to Program.
The image below shows how the standard TotalAggregate function (Sum) result is displayed. The TotalAggregateText is set to "Total:".
Setting TotalAggregateType property to Program allows to pass a specific value to the Total Aggregate field. To do it, specify the name for the aggregate field using the TotalAggregateName property, and use this name as a field identifier in the DISPLAY .. TO statement.
In the following example the value of the variable sal_cf will be displayed to the column's aggregate field where f_coefficient is specified as the TotalAggregateName:
DISPLAY sal_cf TO f_coefficient
CVS server: client.querix.com
CVS repository: /presentation
User: client
Project: form-demo3-2014
Program: fd2_panel_table_column_prop_total_aggregates