Sorter: ILanerSorter;
The Sorter property returns sorting options for the workbook.
Two types of sorting are available in a workbook:
Sorting based on values of time series observations. Use the ILanerSorterData interface.
Sorting based on values of time series attributes. Use the ILanerSorterHeader interface.
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 working area of the time series database should be loaded to UiErAnalyzer1.
Add links to the Express, ExtCtrls, Forms, Laner, and Tab system assemblies.
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: