ILanerSorter.HeadersSort

Fore Syntax

HeadersSort: ILanerSorterHeader;

Fore.NET Syntax

HeadersSort: Prognoz.Platform.Interop.Laner.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.

Fore 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.

Fore.NET Example

Executing the example requires a form with the LanerBoxNet component and the UiErAnalyzerNet component with the UiErAnalyzerNet1 identifier that is a data source for LanerBoxNet. Workbook of the time series database must be loaded to UiErAnalyzerNet1.

Imports Prognoz.Platform.Interop.Laner;

Sub UserPr();
Var
    Laner: ILaner;
    Ls: ILanerSorter;
    HeaderSort: ILanerSorterHeader;
    Columns: ILanerAttributeColumns;
    i: Integer;
    Inv: Boolean;
    LCol: ILanerColumn;
Begin
    Laner := UiErAnalyzerNet1.ErAnalyzer.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 that contains 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.lcltInversion Then
            inv := True;
            Break;
        End If;
    End For;
    If Not inv Then
        LCol := Columns.AddByType(LnColumnType.lcltInversion);
    End If;
    // Set sorting direction
    HeaderSort.SortColumnDirection[LCol] := LnSortDirection.lsdAscending;
End Sub UserPr;

Procedure execution result: ascending sorting on values of the Display format attribute is set for the workbook. If values of the attribute are not displayed in the workbook, the corresponding value column is shown.

See also:

ILanerSorter