ParamsValues: IMetabaseObjectParamValues;
ParamsValues: IMetabaseObjectParamValues;
The ParamsValues property determines values of automatic cube parameters.
To execute the example, add links to the Metabase, Cubes and Dimensions system assemblies. The repository must contain an automatic cube with the AUTOCUBE identifier.
Sub UserProc;
Var
Update: IMetabaseUpdate;
CubeNode: IMetabaseUpdateDataObjectNode;
Object: IMetabaseObject;
Filter: IAutoCubeUpdateFilter;
Sel: IDimSelection;
ParamsVal: IMetabaseObjectParamValues;
CubeInst: ICubeInstance;
Mb: IMetabase;
Begin
Mb := MetabaseClass.Active;
Update := Mb.CreateUpdate;
CubeNode := Update.RootFolder.Add(MetabaseUpdateNodeType.DataObject) As IMetabaseUpdateDataObjectNode;
Object := Mb.ItemById("AUTOCUBE").Bind;
CubeNode.Object := Object;
CubeNode.Label := CubeNode.Object.Name;
CubeNode.Method := MetabaseUpdateMethod.All;
CubeNode.IncludeData := True;
CubeNode.ExtendedParams := Object.CreateUpdateExParams;
Filter := CubeNode.ExtendedParams As IAutoCubeUpdateFilter;
ParamsVal:= Object.Params.CreateEmptyValues;
ParamsVal.Item(0).Value := "Parameter1";
Filter.ParamValues := ParamsVal;
CubeInst := Object.Open(ParamsVal) As ICubeInstance;
Filter.SelectionSet := CubeInst.Destinations.DefaultDestination.CreateDimSelectionSet;
For Each Sel In Filter.SelectionSet Do
If sel.Dimension.Ident = "CALENDAR" Then
sel.SelectSiblings(0);
Else
Sel.SelectElement(0, true);
End If;
End For;
Update.SaveToFileNF("c:\temp\autocube.pefx");
End Sub UserProc;
After executing the example an update file is created in the c:\temp folder.
To execute the example, add links to the Metabase, Cubes and Dimensions system assemblies. The repository must contains an automatic cube with the AUTOCUBE identifier.
Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.Cubes;
Imports Prognoz.Platform.Interop.Dimensions;
Public Shared Sub Main(Params: StartParams);
Var
Update: IMetabaseUpdate;
CubeNode: IMetabaseUpdateDataObjectNode;
Object: IMetabaseObject;
Filter: IAutoCubeUpdateFilter;
Sel: IDimSelection;
ParamsVal: IMetabaseObjectParamValues;
CubeInst: ICubeInstance;
Mb: IMetabase;
Begin
Mb := Params.Metabase;
Update := Mb.CreateUpdate();
CubeNode := Update.RootFolder.Add(MetabaseUpdateNodeType.untDataObject) As IMetabaseUpdateDataObjectNode;
Object := Mb.ItemById["AUTOCUBE"].Bind();
CubeNode.Object := Object;
CubeNode.Label := CubeNode.Object.Name;
CubeNode.Method := MetabaseUpdateMethod.mumAll;
CubeNode.IncludeData := True;
CubeNode.ExtendedParams := Object.CreateUpdateExParams();
Filter := CubeNode.ExtendedParams As IAutoCubeUpdateFilter;
ParamsVal := Object.Params.CreateEmptyValues();
ParamsVal.Item[0].Value := "Parameter1";
Filter.ParamValues := ParamsVal;
CubeInst := Object.Open(ParamsVal) As ICubeInstance;
Filter.SelectionSet := CubeInst.Destinations.DefaultDestination.CreateDimSelectionSet();
For Each Sel In Filter.SelectionSet Do
If sel.Dimension.Ident = "CALENDAR" Then
sel.SelectSiblings(0);
Else
Sel.SelectElement(0, True);
End If;
End For;
Update.SaveToFileNF("c:\temp\autocube.pefx");
End Sub;
After executing the example an update file is created in the c:\temp folder.
See also: