IBindingDimCombo.SortDirection

Syntax

SortDirection: DimComboSortDirection;

SortDirection: Prognoz.Platform.Interop.ForeSystem.DimComboSortDirection;

Description

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

Comments

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

The parameter value is set in connection 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.

Fore and Fore.NET Examples

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, ForeSystem (for the Fore.NET example) 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;

Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.Report;
Imports Prognoz.Platform.Interop.Tab;
Imports Prognoz.Platform.Interop.ForeSystem;

Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    Report: IPrxReport;
    Tab: ITabSheet;
    Style: ITabCellStyle;
    BM: IBindingManager;
    DimComboBinding: IBindingDimCombo;
    DimCombo: String;
Begin
    
// Get the current repository
    MB := Params.Metabase;
    
// 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.dmDescending;
    
// Transform parameters to connection string
    DimCombo := DimComboBinding.AsString;
    
// Set cell format
    Style.Binding := DimCombo;
    
// Save changes
    (Report As IMetabaseObject).Save();
End Sub;

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