ICalculatedCubeInstance.View

Syntax

View(Source: ICubeInstanceSource): ICalculatedCubeFormulasView;

Parameters

Source - cube, for which display parameters of dimension elements must be set.

Description

The View property returns parameters of the elements dimensions layout in a cube and cube formulas.

Example

Executing the example requires that the repository contains a calculated cube with the Calc_Cube identifier.

Sub Main;

Var

MB: IMetabase;

CubeInst: ICalculatedCubeInstance;

View: ICalculatedCubeFormulasView;

Dim: IDimensionModel;

i, j, Key: Integer;

Begin

MB := MetabaseClass.Active;

CubeInst := MB.ItemById("Calc_Cube").Open(Null) As ICalculatedCubeInstance;

View := CubeInst.View(Null);

For i := 0 To View.Count - 1 Do

Dim := View.Dimension(i);

Key := (Dim As IMetabaseObject).Key;

View.FormulaNaming(Key) := Dim.Attributes.Id;

View.ViewNaming(Key) := Dim.Attributes.Id;

End For;

For i := 0 To CubeInst.Sources.Count - 1 Do

View := CubeInst.View(CubeInst.Sources.Item(i));

For j := 0 To View.Count - 1 Do

Dim := View.Dimension(j);

Key := (Dim As IMetabaseObject).Key;

View.FormulaNaming(Key) := Dim.Attributes.Id;

View.ViewNaming(Key) := Dim.Attributes.Id;

End For;

End For;

CubeInst.SaveFormulas;

End Sub Main;

After executing the example a layout of dimension elements of calculated cube and all source cubes are set. Identifiers of elements are displayed in dimensions and formulas.

See also:

ICalculatedCubeInstance