ParamProvider: Object;
ParamProvider: object;
The ParamProvider property returns object to work with parameters of express report.
After data source parameters editing, the source must be updated. To update data source, use IEaxAnalyzer.UpdateParamProvider.
Executing the examplerequires that the repository contains express report with the EXPRESS identifier. Data source is a cube.
Add links to the Dal, Express, Metabase, Ms, Transform system assemblies.
Sub UserProc;
Var
MB: IMetabase;
MetObj: IMetabaseObject;
Express: IEaxAnalyzer;
CreateParam: IMetabaseObjectParam;
CreateValues: IMetabaseObjectParamValues;
Provider: IMsParamProvider;
ModelParam: IMsModelParam;
Begin
// Get repository
MB := MetabaseClass.Active;
// Get express report
MetObj := MB.ItemById("EXPRESS").Edit;
Express := MetObj As IEaxAnalyzer;
// Create parameter
CreateParam := MetObj.Params.Add;
CreateParam.DataType := DbDataType.Integer;
CreateParam.Name := "Parameter";
CreateParam.DefaultValue := 100;
// Create values for parameter
CreateValues := CreateParam.Params.CreateEmptyValues;
CreateValues.Item(0).Value := 150;
// Set specified values for parameter
Express.OwnParamValues := CreateValues;
// Get object - data source
Provider := Express.ParamProvider As IMsParamProvider;
// Create parameter in data source
ModelParam := Provider.Params.Add;
ModelParam.Name := "Data_Parameter";
ModelParam.DefaultValue := 1000;
ModelParam.ParamType := TsParamType.Simple;
// Update data source
Express.UpdateParamProvider;
// Save changes
MetObj.Save;
End Sub UserProc;
After executing the example, parameter named Parameter is created in the express report. In data source parameter named Data_Parameter will be created.
The requirements and result of the Fore.NET Example execution match with those in the Fore Example.
Imports Prognoz.Platform.Interop.Dal;
Imports Prognoz.Platform.Interop.Express;
Imports Prognoz.Platform.Interop.Ms;
Imports Prognoz.Platform.Interop.Transform;
…
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
MetObj: IMetabaseObject;
Express: IEaxAnalyzer;
CreateParam: IMetabaseObjectParam;
CreateValues: IMetabaseObjectParamValues;
Provider: IMsParamProvider;
ModelParam: IMsModelParam;
Begin
// Get repository
MB := Params.Metabase;
// Get express report
MetObj := MB.ItemById["EXPRESS_IEAX"].Edit();
Express := MetObj As IEaxAnalyzer;
// Create parameter
CreateParam := MetObj.Params.Add();
CreateParam.DataType := DbDataType.ddtInteger;
CreateParam.Name := "Parameter";
CreateParam.DefaultValue := 100;
// Create values for parameter
CreateValues := CreateParam.Params.CreateEmptyValues();
CreateValues.Item[0].Value := 150;
// Set specified values for parameter
Express.OwnParamValues := CreateValues;
// Get object - data source
Provider := Express.ParamProvider As IMsParamProvider;
// Create parameter in data source
ModelParam := Provider.Params.Add();
ModelParam.Name := "Data Parameter";
ModelParam.DefaultValue := 1000;
ModelParam.ParamType := TsParamType.tsptSimple;
// Update data source
Express.UpdateParamProvider();
// Save changes
MetObj.Save();
End Sub;
See also: