ParamValues: IMetabaseObjectParamValues;
The ParamValues property returns an object that contains parameters values for opening nested objects.
When opening repository object with parameters, an object that contains data and is embedded with opened object is created in cache. To reopen an object with new parameter values, clear cache in the opened object (Flush, FlushById) or assign empty values (CreateEmptyValues) to all parameters of the used object.
Executing the example requires that the repository contains a parametric dictionary with the PARAM_DICT identifier. The dictionary must contain a numeric parameter with the ITEM identifier that influences filtering elements.
Add links to the Dimensions, Metabase system assemblies.
Sub UserProc;
Var
MB: IMetabase;
currObj: IMetabaseObject;
currPar: IMetabaseObjectParamValues;
currDimInst: IDimInstance;
currEls: IDimElements;
Begin
MB := MetabaseClass.Active;
Debug.WriteLine("Open dictionary with the '0' parameter");
currObj := MB.ItemById("PARAM_DICT").Bind;
currPar := currObj.ParamValues;
currPar.FindById("ITEM").Value := 0;
currDimInst := currObj.Open(currPar) As IDimInstance;
currEls := currDimInst.Elements;
Debug.WriteLine("Number of elements: " + currEls.Count.ToString);
Debug.WriteLine("Open dictionary with the '10' parameter");
currPar := currObj.Params.CreateEmptyValues;
currPar.FindById("ITEM").Value := 10;
currDimInst := currObj.Open(currPar) As IDimInstance;
currEls := currDimInst.Elements;
Debug.WriteLine("Number of elements: " + currEls.Count.ToString);
End Sub UserProc;
After executing the example the dictionary is opened with different parameter values. The console window displays the number of dictionary elements after filtering.
See also: