IDimSelection.PredefinedSchema

Fore Syntax

PredefinedSchema: IPredefinedSelectionSchema;

Fore.NET Syntax

PredefinedSchema: Prognoz.Platform.Interop.Dimensions.IPredefinedSelectionSchema;

Description

The PredefinedSchema property returns an object for working with predefined selection schema of dimension.

Comments

Pre-defined schema of selection is used to automatic adding of a new dimension element to selection after dimension reopening.

Fore Example

Executing the example requires that the repository contains an express report with the EXPRESS identifier containing table.

Add links to the Dimensions, Express, Metabase, Pivot system assemblies.

Sub UserProc;
Var
    MB: IMetabase;
    Express: IEaxAnalyzer;
    Selection: IDimSelection;
    PreSchema: IPredefinedSelectionSchema;
Begin
    // Get repository
    MB := MetabaseClass.Active;
    // Get express report
    Express := MB.ItemById("EXPRESS").Edit As IEaxAnalyzer;
    // Get dimension selection
    Selection := Express.Pivot.Selection.Item(3);
    // Get predefined schema of dimension selection
    PreSchema := Selection.PredefinedSchema;
    // Select all elements
    If (PreSchema <> NullThen
        If (PreSchema.Count = 0Then
            PreSchema.Add(SelectionPrimitiveType.All);
        End If;
        // Use predefined schema of dimension selection
        PreSchema.Active := True;
    End If;
    // Save report
    (Express As IMetabaseObject).Save;
End Sub UserProc;

After executing the example in specified dimension on adding a new element, it will automatically added in selection after report reopening.

Fore.NET Example

The requirements and result of the Fore.NET example execution match with those in the Fore Example.

Imports Prognoz.Platform.Interop.Dimensions;
Imports Prognoz.Platform.Interop.Express;
Imports Prognoz.Platform.Interop.Pivot;

Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    Express: IEaxAnalyzer;
    Selection: IDimSelection;
    PreSchema: IPredefinedSelectionSchema;
Begin
    // Get repository
    MB := Params.Metabase;
    // Get express report
    Express := MB.ItemById["EXPRESS"].Edit() As IEaxAnalyzer;
    // Get dimension selection
    Selection := Express.Pivot.Selection.Item[3];
    // Get predefined schema of dimension selection
    PreSchema := Selection.PredefinedSchema;
    // Select all elements
    If (PreSchema <> NullThen
        If (PreSchema.Count = 0Then
            PreSchema.Add(SelectionPrimitiveType.sptAll);
        End If;
        // Use predefined schema of dimension selection
        PreSchema.Active := True;
    End If;
    // Save report
    (Express As IMetabaseObject).Save();
End Sub;

See also:

IDimSelection