IPrxDataIslandDimensionLayout.Build

Fore Syntax

Build(Selection: IDimSelection);

Fore.NET Syntax

Build(Selection: Prognoz.Platform.Interop.Dimensions.IDimSelection);

Parameters

Selection. Selection in dimension.

Description

The Build method adds elements corresponding to selected dimension elements to arbitrary layout.

Comments

Depending on values combinations of the PreserveDimensionElementsOrder and MergeWithSelection properties the Build method works as follows:

PreserveDimensionElementsOrder

MergeWithSelection

Build method effect

False

False

None.

False

True

Adds selection elements, missing in the arbitrary layout.

True

False

Restores order for existing elements of the arbitrary layout.

True

True

Restores order for existing elements of arbitrary layout, adding selection elements missing in the arbitrary layout.

Fore Example

Executing the example requires a regular report with the REPORT identifier. This report must contain a data area containing a slice with dimension with the DIMENSION identifier.

Sub UserProc;
Var
    MB: IMetabase;
    Report: IPrxReport;
    DataIsland: IPrxDataIsland;
    DimS: IPrxSliceDimension;
    Dim: IPrxDataIslandDimension;
Begin
    MB := MetabaseClass.Active;
    Report := MB.ItemById(
"REPORT").Edit As IPrxReport;
    DataIsland := Report.DataIslands.Item(
0).Edit;
        DimS := DataIsland.Slice.Dimensions.FindById(
"DIMENSION"As IPrxSliceDimension;
        Dim := DataIsland.Properties.Dimension(DimS.Dimension.Dimension);
        Dim.CustomLayout := 
True;
        Dim.Layout.MergeWithSelection := 
True;
        Dim.Layout.Build(DimS.Selection);
        Dim.Layout.Save;
    DataIsland.Save;
    (Report 
As IMetabaseObject).Save;
End Sub UserProc;

After executing the example for a dimension with the DIMENSION identifier the arbitrary layout with adding all elements of the dimension selection is set up. After that the report with all changes is saved.

Fore.NET Example

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

Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.Report;
Imports Prognoz.Platform.Interop.Dimensions;

Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    Report: IPrxReport;
    DataIsland: IPrxDataIsland;
    DimS: IPrxSliceDimension;
    Dim: IPrxDataIslandDimension;
Begin
    MB := Params.Metabase;
    Report := MB.ItemById["REPORT"].Edit() As IPrxReport;
    DataIsland := Report.DataIslands.Item[0].Edit();
        DimS := DataIsland.Slice.Dimensions.FindById("DIMENSION"As IPrxSliceDimension;
        Dim := DataIsland.Properties.Dimension[DimS.Dimension.Dimension];
        Dim.CustomLayout := True;
        Dim.Layout.MergeWithSelection := True;
        Dim.Layout.Build(DimS.Selection);
        Dim.Layout.Save();
    DataIsland.Save();
    (Report As IMetabaseObject).Save();
End Sub;

See also:

IPrxDataIslandDimensionLayout