ILanerSorter.HeadersSort

Syntax

HeadersSort: ILanerSorterHeader;

Description

The HeadersSort property returns options of sorting based on values of time series attributes.

Comments

By default the workbook data is not sorted based on values of time series attributes.

Example

Executing the example requires a form with the LanerBox component and the UiErAnalyzer component with the UiErAnalyzer1 identifier, that is a data source for LanerBox. Workbook of the time series database must be loaded to UiErAnalyzer1.

Sub UserPr;
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 UserPr;

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:

ILanerSorter