SaveFormulasToFile(FileName: String; Selection: IDimSelectionSet);
FileName. Name and path to the file where calculated cube formulas are stored.
Selection. Selection of cube elements for which formulas must be stored.
The SaveFormulasToFile method saves calculated cube formulas to a file.
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(Null) As 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: