LoadFormulasFromFile(FileName: String; [Append: Boolean = False]);
FileName. Name and path to the file, from which calculated cube formulas are loaded.
Append. Optional parameter that determines whether formulas are added to existing cube.
The LoadFormulasFromFile method loads calculated cube formulas from file.
The Append parameter is set to False by default, and all existing formulas are deleted before loading. If the parameter is set to True, formulas in the cube are substituted only by the file coordinates, the rest of the formulas are saved.
Executing the example requires that the repository contains a calculated cube with the Calc_Cube identifier.
Sub UserProc;
Var
MB: IMetabase;
CubeInst: ICalculatedCubeInstance;
Begin
MB := MetabaseClass.Active;
CubeInst := MB.ItemById("Calc_Cube").Open(Null) As ICalculatedCubeInstance;
CubeInst.LoadFormulasFromFile("D:\Work\formul.txt", True);
CubeInst.SaveFormulas;
End Sub UserProc;
After executing the example formulas from the file formul.txt are loaded to the cube. Formulas by existing in file coordinates are changed, other formulas are saved.
See also: