Below is the example of express report opening with setting of cube parameters and/or selection.
Executing the example requires an express report with the EXPRESS identifier created on a parametric cube.
Add links to the Express, Metabase, Ui, Pivot, and Dimensions system assemblies.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
Mb: IMetabase;
Obj: IMetabaseObject;
Params: IMetabaseObjectParamValues;
Target: IUiCommandTarget;
Context: IUiCommandExecutionContext;
ex: IEaxAnalyzer;
Pivot: IPivot;
Selection: IDimSelection;
Begin
MB := MetabaseClass.Active;
Obj := MB.ItemById("EXPRESS").Edit;
ex := Obj As IEaxAnalyzer;
// Set value to the parameter
Params := ex.ParamValues;
Params.Item(0).Value := "15";
ex.ParamValues := Params;
// Set selection to calendar dimension
Pivot := ex.Pivot;
Pivot.BeginSelectionUpdate;
Selection := Pivot.Selection.FindById("D_CALENDAR");
Selection.DeselectAll;
Selection.SelectElement(2, False);
Pivot.EndSelectionUpdate;
Target := WinApplication.Instance.GetPluginTarget("Express");
Context := Target.CreateExecutionContext;
Context.Data := ex;
Target.Execute("ShowReporter", Context);
End Sub Button1OnClick;
After executing the example the express report is opened, the first cube parameter is set to 15. The third dimension element is selected in the dimension with the D_CALENDAR identifier.
See also: