View: ICalculatedCubeFormulasView;
View: Prognoz.Platform.Interop.Metabase.ICalculatedCubeFormulasView;
The View property returns display parameters of elements in dimensions and formulas of multidimensional calculation.
Executing the example requires that the repository contains multidimensional calculation on DB server with the MDCalc_1 identifier.
Sub UserProc;
Var
MB: IMetabase;
MDCalc: IMDCalculationInstance;
Source: IMDCalculationSourceInstance;
View: ICalculatedCubeFormulasView;
Slice: IMDCalculationSliceInstance;
Dim: IDimensionModel;
Begin
MB := MetabaseClass.Active;
//Multidimensional calculation
MDCalc := MB.ItemById("MDCalc_1").Open(Null) As IMDCalculationInstance;
//Data source of multidimensional calculation
Source := MDCalc.Sources.FindById("Data_1");
Slice := Source.Slices.FindById("Country");
Dim := Slice.Dimension.Dimension;
//Display parameters for dimensions and for formulas
View := Source.View;
View.FormulaNaming(Slice.Key) := Dim.Attributes.Id;
View.ViewNaming(Slice.Key) := Dim.Attributes.Name;
MDCalc.SaveView;
End Sub UserProc;
On executing the example display parameters of elements in dimension and formulas are set up for the specified dimension of data source. The names are displayed in the dimension, and the element identifiers are displayed in formulas.
Executing the example requires that the repository contains multidimensional calculation on DB server with the MDCalc_1 identifier. The specified procedure is an entry point of the .NET assembly.
Imports Prognoz.Platform.Interop.Cubes;
Imports Prognoz.Platform.Interop.Dimensions;
Imports Prognoz.Platform.Interop.Metabase;
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
MDCalc: IMDCalculationInstance;
Source: IMDCalculationSourceInstance;
View: ICalculatedCubeFormulasView;
Slice: IMDCalculationSliceInstance;
Dim: IDimensionModel;
Begin
MB := Params.Metabase;
//Multidimensional calculation
MDCalc := MB.ItemById["MDCalc_1"].Open(Null) As IMDCalculationInstance;
//Data source of multidimensional calculation
Source := MDCalc.Sources.FindById("Data_1");
Slice := Source.Slices.FindById("Country");
Dim := Slice.Dimension.Dimension;
//Display parameters for dimensions and for formulas
View := Source.View;
View.FormulaNaming[Slice.Key] := Dim.Attributes.Id;
View.ViewNaming[Slice.Key] := Dim.Attributes.Name;
MDCalc.SaveView();
End Sub;
On executing the example display parameters of elements in dimension and formulas are set up for the specified dimension of data source. The names are displayed in the dimension, and the element identifiers are displayed in formulas.
See also: