IBindingDimCombo.SortDirection

Syntax

SortDirection: DimComboSortDirection;

Description

The SortDirection property determines whether there is the SORTDIRECTION parameter in binding string.

Comments

The SORTDIRECTION parameter determines option of sorting dictionary elements by name.

The parameter value is set in binding string using the SortDirection property or manually as follows:

SORTDIRECTION="VALUE"

Where:

Description of parameter values:

Value Description
NONE Dictionary elements are not sorted.
ASC Dictionary elements are sorted in ascending and alphabetical order or by text values of numbers.
DESC Dictionary elements are sorted in descending and alphabetical order or by text values of numbers.

Example

Executing the example requires that the repository contains a regular report with the REPORT identifier and a dictionary with the D_SEP identifier.

Add links to the Metabase, Report, Tab, and ForeSystem system assemblies.

Sub UserProc;
Var
    MB: IMetabase;
    Report: IPrxReport;
    Tab: ITabSheet;
    Style: ITabCellStyle;
    BM: IBindingManager;
    DimComboBinding: IBindingDimCombo;
    DimCombo: String;
Begin
    
// Get the current repository
    MB := MetabaseClass.Active;
    
// Get regular report
    Report := MB.ItemById("REPORT").Edit As IPrxReport;
    
// Get style of the first cell in upper left corner of report
    Tab := (Report.ActiveSheet As IPrxTable).TabSheet;
    Style := Tab.Cell(00).Style;
    
// Set value editor parameters
    BM := New BindingManager.Create;
    DimComboBinding := BM.CreateByUi(
"DimCombo"As IBindingDimCombo;
    DimComboBinding.Object := 
"D_SEP";
    DimComboBinding.SortDirection := DimComboSortDirection.Descending;
    
// Transform parameters to connection string
    DimCombo := DimComboBinding.AsString;
    
// Set cell format
    Style.Binding := DimCombo;
    
// Save changes
    (Report As IMetabaseObject).Save;
End Sub UserProc;

After executing the example the first cell of regular report sets the format of drop-down list of the dictionary with the D_SEp identifier, which elements are displayed in descending and alphabetical order or by text values of numbers.

See also:

IBindingDimCombo