ICalculatedCubeInstance.SaveFormulasToFile

Syntax

SaveFormulasToFile(FileName: String; Selection: IDimSelectionSet);

Parameters

FileName. Name and path to the file where calculated cube formulas are stored.

Selection. Selection of cube elements for which formulas must be stored.

Description

The SaveFormulasToFile method saves calculated cube formulas to a file.

Example

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

Sub Main;
Var
    MB: IMetabase;
    CubeInst: ICalculatedCubeInstance;
    DimSS: IDimSelectionSet;
    DimSel: IDimSelection;
Begin
    MB := MetabaseClass.Active;
    CubeInst := MB.ItemById(
"Calc_Cube").Open(NullAs ICalculatedCubeInstance;
    DimSS := CubeInst.Destination.CreateDimSelectionSet;
    
For Each DimSel In DimSS Do
        DimSel.SelectAll;
    
End For;
    CubeInst.SaveFormulasToFile(
"C:\formul.txt", DimSS);
End Sub Main;

After executing the example formulas of the Calc_Cube calculated cube are saved in the file formul.txt.

See also:

ICalculatedCubeInstance