Sorter: ILanerSorter;
Sorter: Prognoz.Platform.Interop.Laner.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 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.
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;
…
Public Sub UserProc();
Var
Laner: ILaner;
Ls: ILanerSorter;
DataSort: ILanerSorterData;
DimElement: uinteger;
Dir: LnSortDirection;
Begin
Laner := UiErAnalyzerNet1.ErAnalyzer.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.lsdAscending Then
DataSort.SortDirection[DimElement] := LnSortDirection.lsdDescending;
Else
DataSort.SortDirection[DimElement] := LnSortDirection.lsdAscending;
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: