IPivot.SortDiapason

Syntax

SortDiapason: PivotSortDiapason;

Description

TheSortDiapason property determines the sorting mode in table.

Example

To execute the example, on the form place the Button component named Button1, the TabSheetBox component named TabSheetBox1, and the UiErAnalyzer component named UiErAnalyzer1. Specify UiErAnalyzer1 as a data source for TabSheetBox1. An express report is a data source for UiErAnalyzer1.

Add links to the Express, Forms, Pivot, and Tab system assemblies.

The example is a handler of the OnClick event for the Button1 component.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    OLAP: IEaxAnalyzer;
    Pivot: IPivot;
    Sorter: IPivotSorter;
    SortItem: IPivotSortItem;
Begin
    OLAP := UiErAnalyzer1.ErAnalyzer;
    Pivot := OLAP.Pivot;
    Sorter := Pivot.Sorter;
    
// Set sorting parameters
    SortItem := Sorter.Add;
    SortItem.Kind := PivotSortKind.Column;
    SortItem.IndexInHeader := 
0;
    SortItem.Direction := PivotSortDirection.Asc;
    Pivot.SortDiapason := PivotSortDiapason.Level;
    
// Refresh table
    Pivot.Refresh;
End Sub Button1OnClick;

Clicking the button starts ascending sorting of the first table column values. Sorting is executed by hierarchy levels within one group.

Source data:

Sorted data:

See also:

IPivot