ILaner.Sorter

Syntax

Sorter: ILanerSorter;

Description

The Sorter property returns sorting options for the workbook.

Comments

Two types of sorting are available in a workbook:

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 UserProc;
Var
    Laner: ILaner;
    Ls: ILanerSorter;
    DataSort: ILanerSorterData;
    DimElement: Integer;
    Dir: LnSortDirection;
Begin
    Laner := UiErAnalyzer1.ErAnalyzer.Laner;
    Ls := Laner.Sorter;
    // Get data sorting options
    DataSort := Ls.SeriesDataSort;
    // Change sorting direction
    If DataSort.Count > 0 Then
        DimElement := DataSort.CalendarElement(0);
        Dir := DataSort.SortDirection(DimElement);
        If Dir = LnSortDirection.Ascending Then
            DataSort.SortDirection(DimElement) := LnSortDirection.Descending;
        Else
            DataSort.SortDirection(DimElement) := LnSortDirection.Ascending;
        End If;
    End If;
End Sub UserProc;

Procedure execution result: if data sorting is set for the workbook, the sorting direction is changed to the opposite one.

See also:

ILaner