HeadersSort: ILanerSorterHeader;
The HeadersSort property returns options of sorting based on values of time series attributes.
By default the workbook data is not sorted based on values of time series attributes.
Executing the example requires a form with the following components: the Button component named Button1, the LanerBox component named LanerBox1, and the UiErAnalyzer component named UiErAnalyzer1. UiErAnalyzer1 is a data source for LanerBox1. A workbook of the time series database should be loaded to UiErAnalyzer1. Before executing the example select one series in the LanerBox1 component.
Add links to the Laner system assembly.
Sub UserProc;
Var
Laner: ILaner;
Ls: ILanerSorter;
HeaderSort: ILanerSorterHeader;
Columns: ILanerAttributeColumns;
i: Integer;
Inv: Boolean;
LCol: ILanerColumn;
Begin
Laner := UiErAnalyzer1.ErAnalyzer.Laner;
Ls := Laner.Sorter;
// Get options of sorting based on values of time series attributes
HeaderSort := Ls.HeadersSort;
// Reset current sorting options
HeaderSort.Clear;
// Get the column containing values of the attribute Display Format
Columns := Laner.AttributeColumns;
For i := 0 To Columns.Count - 1 Do
LCol := Columns.Column(i);
If LCol.Type = LnColumnType.Inversion Then
inv := True;
Break;
End If;
End For;
If Not inv Then
LCol := Columns.AddByType(LnColumnType.Inversion);
End If;
// Set sorting direction
HeaderSort.SortColumnDirection(LCol) := LnSortDirection.Ascending;
End Sub UserProc;
Procedure execution result: ascending sorting on values of the Display format attribute is set for the workbook. If values of this attribute are not displayed in the workbook, the corresponding value column is shown.
See also: