ICubeSerialInstance.Save

Syntax

Save(

Destination: ICubeInstanceDestination;

Selection: IDimSelectionSet;

[Options: Integer = 0]): ICubeInstanceDestination;

Parameters

Destination. The cube display version, according to which saved data is calculated.

Selection. Cube selection, according to which the saved data is calculated.

Options. Parameter, available from the kernel, saves either all values in the dimension or selected values only, depending on the value.

Description

The Save method saves a cube data to a file.

Comments

The Options parameter can take the following values:

Example

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

Sub UserProc;
Var
    MB: IMetabase;
    Des: IMetabaseObjectDescriptor;
    CubInst: ICubeInstance;
    CubeDist: ICubeInstanceDestination;
    CubSer: ICubeSerializer;
    CubSerIns: ICubeSerialInstance;
    DimSS: IDimSelectionSet;
    DimS: IDimSelection;
Begin
    MB := MetabaseClass.Active;
    CubSer := New CubeSerializer.Create As ICubeSerializer;
    CubSer.StorageType := CubeSerialStorageType.SingleFile;
    CubSer.FileName := "cub";
    Des := MB.ItemById("CUBE_1");
    CubInst := Des.Open(NullAs ICubeInstance;
    CubeDist := CubInst.Destinations.DefaultDestination;
    CubSerIns := CubSer.SaveToFile("c:\cub.ppcube", CubInst);
    DimSS := CubeDist.CreateDimSelectionSet;
    For Each DimS In DimSS Do
        DimS.SelectElement(0False);
    End For;
    CubSerIns.Save(CubeDist, DimSS, 1);
End Sub UserProc;

After executing the example the cube with data contained only in the selected elements will be saved to the cub.ppcube file. The structure of dimensions also saves only selected elements.

See also:

ICubeSerialInstance