ICalculateCubeScheduledTask.LoadSelection

Syntax

LoadSelection(Value: IDimSelectionSet): IDimSelectionSet;

Parameters

Value. Empty selection of source cube, in which selection, according to which loading in cube is executed, is loaded.

Description

The LoadSelection method copies the selection, according to which the data is loaded to a cube.

Example

Executing the example requires that the repository contains a scheduled tasks container. The container has a task of executing the calculated cube configured for starting a cube loader.

Sub Main;

Var

MB: IMetabase;

CubeIns: ICubeInstance;

Loader: ICubeLoader;

MObj: IMetabaseObject;

LoaderTask: ICalculateCubeScheduledTask;

DimSS: IDimSelectionSet;

DimS: IDimSelection;

Begin

MB := MetabaseClass.Active;

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

//Task of launching a cube loader

LoaderTask := MObj As ICalculateCubeScheduledTask;

Loader := (LoaderTask.SourceCube As ICubeLoader);

//Receiving empty selection by which data loading is to be performed

CubeIns := (Loader.Destination.Cube As IMetabaseObject).Open(Null) As ICubeInstance;

DimSS := CubeIns.Destinations.DefaultDestination.CreateDimSelectionSet;

//Copying of the selection already set for the task

DimSS := LoaderTask.LoadSelection(DimSS);

/Changing selection

For Each DimS In DimSS Do

DimS.DeselectAll;

DimS.SelectElement(0, True);

End For;

//Setting new selection

LoaderTask.SetSelection(DimSS);

MObj.Save;

End Sub Main;

After executing the example the selection, by which loading is executed, is changed for the task of starting a cube loader.

See also:

ICalculateCubeScheduledTask