Calculations at Sort Level Break
You want to execute an operation when a sort level changes. For example, you can use the Number operation to count the number of sort levels and display it before each sort level. The procedure refers to Number operations only, since this calculation event does not make sense for the other operation types.
You created a table node and use the Data tab to read your internal table.
On the Data tab enter a sort criterion and mark Event on Sort Begin
and Event on Sort End
.
Go to the Calculations
tab.
Select Number
as Operation
.
Under Target Field Name
enter a field with data type integer (I).
As calculation event specify Before Sorting
or After Sorting
. If, for example, you want to start numbering at 1 and display the number as a heading before the sort level, you must select Before Sorting
.
Caution
Calculations at Before Sorting
or After Sorting
can be executed only if on the Data tab either Event on Sort Begin
or Event on Sort End
is marked.
To initialize the target field before table output, mark the checkbox in the Initialization
column.
Display the target field in a table cell at the beginning or end of the sort level.
You count the number of sort levels. At the beginning or end of the sort levels you can display the target field as the sort level number. In the footer you can display the total number of sort levels.