ICubeSerializer.LoadFromFile

Syntax

LoadFromFile(FileName: String; [Options: Integer = 0]): ICubeSerialInstance;

Parameters

FileName. Path and name of the file that is loaded from.

Options. Parameter is not used.

Description

The LoadFromFile method loads the cube saved to a file.

Example

Executing the example requires a form, a button on it, the UiErAnalyzer component named UiErAnalyzer1, a file named c:\cub.ppcube that contains the saved cube and any components that display express report data.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    CubS: ICubeSerializer;
    CubSIns: ICubeSerialInstance;
    MatDs: IMatrixDataSource;
    MB: IMetabase;
    CrInfo: IMetabaseObjectCreateInfo;
    MObj: IMetabaseObject;
Begin
    MB := MetabaseClass.Active;
    CubS := New CubeSerializer.Create As ICubeSerializer;
    CubSIns := CubS.LoadFromFile("c:\cub.ppcube");
    MatDS := CubSIns.Destinations.Item(0As IMatrixDataSource;
    CrInfo := MB.CreateCreateInfo;
    CrInfo.Id := "Temp_Express";
    CrInfo.ClassId := MetabaseObjectClass.KE_CLASS_EXPRESSREPORT;
    MObj := MB.CreateObject(CrInfo).Bind;
    UiErAnalyzer1.Active := True;
    UiErAnalyzer1.ErAnalyzer := MObj As IEaxAnalyzer;
    UiErAnalyzer1.ErAnalyzer.OpenCube(CubSerIns.Destinations.Item(0).Cube);
End Sub Button1OnClick;

After executing the example pressing the button loads the cube saved to the cub.ppcube file. A temporary express report is created for loading data to UiErAnalyzer1.

See also:

ICubeSerializer