IVirtualCubeSources.Add

Syntax

Add(Source: ICubeModelDestination): IVirtualCubeSource;

Parameters

Source - cube, which must be added to data sources of virtual cube.

Description

The Add method adds a new data source to a virtual cube.

Example

Executing the example requires that the repository contains a virtual cube with the VIRT_CUBE identifier, and a cube with the SourceCube_1 identifier.

Sub Main;

Var

MB: IMetabase;

MObj: IMetabaseObject;

VirtCub: IVirtualCube;

Cub: ICubeModel;

Sources: IVirtualCubeSources;

Source: IVirtualCubeSource;

i: Integer;

Begin

MB := MetabaseClass.Active;

MObj := MB.ItemById("Virt_Cube").Edit;

Cub := MB.ItemById("SourceCube_1").Bind As ICubeModel;

VirtCub := MObj As IVirtualCube;

Sources := VirtCub.Sources;

Source := VirtCub.Sources.Add(Cub.Destinations.DefaultDestination);

For i := 0 To Source.FixInfo.Count - 1 Do

Source.FixInfo.Item(i).Fixed := True;

Source.FixInfo.Item(i).Selection.SelectElement(0, False);

End For;

MObj.Save;

End Sub Main;

After executing the example a cube with the SourceCube_1 identifier is added to data sources of the Virt_Cube virtual cube. All dimensions of the source cube are fixed.

See also:

IVirtualCubeSources