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 UserProc;
Var
    MB: IMetabase;
    CubeInst: ICubeInstance;
    Loader: ICubeLoader;
    LoaderTask: ICalculateCubeScheduledTask;
    DimSS: IDimSelectionSet;
    DimS: IDimSelection;
Begin
    MB := MetabaseClass.Active;
    LoaderTask := MB.ItemById("LoaderTask").Edit As ICalculateCubeScheduledTask;
    // Cube loader startup task
    Loader := (LoaderTask.SourceCube As ICubeLoader);
    // Get empty selection, by which data will be  loaded
    CubeInst := (Loader.Destination.Cube As IMetabaseObject).Open(NullAs ICubeInstance;
    DimSS := CubeInst.Destinations.DefaultDestination.CreateDimSelectionSet;
    // Copy selection that is already set for task
    DimSS := LoaderTask.LoadSelection(DimSS);
    // Change selection
    For Each DimS In DimSS Do
        DimS.DeselectAll;
        DimS.SelectElement(0True);
    End For;
    // Set new selection
    LoaderTask.SetSelection(DimSS);
    (LoaderTask As IMetabaseObject).Save;
End Sub UserProc;

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

See also:

ICalculateCubeScheduledTask