ICompoundDimension.InitCustomContainer

Syntax

InitCustomContainer;

Description

The InitCustomContainer method creates or updates fact dimension (ICustomDimension) based on virtual cube in accordance with 17th release's method.

Comments

This method creates or updates attributes of the dimension set in the CustomContainer property. If this property has empty value, the method searches in child objects of the owner (virtual cube) of this dimension for an object of the class KE_CLASS_CUSTOMDIMENSION with the characteristic  IsInternal  and the FACTS identifier (as had facts of virtual cube in 17th release). If such an object is found, it is used, otherwise a new ICustomDimension object with the structure (owner, identifier, characteristics  IsInternal) set according to the above listed rules, is created and used.

Use this method to ensure correct functioning of virtual cube, if the schema contains binding to the structure of fact dimension of 17th release virtual cube. Examples of binding to structure of fact dimension:

NOTE. This method creates or updates only the structure of fact dimension. The tree of elements needs to be created individually.

Example

The example requires a virtual cube created in 17th release, cube identifier: VIRTUAL_17.

Sub UserProc;

Var

MB: IMetabase;

MObj: IMetabaseObject;

CubV: IVirtualCube;

CompDim : ICompoundDimension;

CustDim : ICustomDimension;

i : Integer;

Function TypeString(CustDim: ICustomDimension; i: Integer): String;

Var

c: String;

Begin

Select Case CustDim.Attributes.Item(i).DataType.ToString

Case "1": c := "String";

Case "2": c := "Integer";

Case "3": c := "Float";

Case "4": c := "DataTime";

End Select;

Return c;

End Function TypeString;

Begin

MB := MetabaseClass.Active;

Mobj:= mb.ItemById("VIRTUAL_17").Edit;

CubV:= Mobj As IVirtualCube;

CompDim := CubV.FactDimension As ICompoundDimension;

CompDim.InitCustomContainer;

CustDim := CompDim.CustomContainer;

Debug.WriteLine("№    ID    Name   Attribute type");

For i:=0 To CustDim.Attributes.Count-1 Do

Debug.WriteLine(i.ToString + "    " + CustDim.Attributes.Item(i).Id + "     " + CustDim.Attributes.Item(i).Name + "       " + TypeString(CustDim,i))

End For;

MObj.Save;

End Sub UserProc;

After executing the example fact dimension is created for the cube in accordance with 17th release procedure. The console window displays identifier, name and type for all attributes of the fact dimension.

See also:

ICompoundDimension