AddDescriptor(Desc: IMetabaseObjectDescriptor): IEaxDataSource;
Desc. Description of the repository object that will be used as an express report data source.
The AddDescriptor method adds a data source to express report by object description in the repository.
Unlike the IEaxDataSources.Add method, the AddDescriptor method adds a data source without its prior opening.
Executing the example requires a button named Button1, the express report with the EXPRESS_REPORT identifier and a cube with the CUBE_1 identifier on the form.
Add links to the Express and Metabase system assemblies.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
MB: IMetabase;
Expr: IEaxAnalyzer;
ExprDS: IEaxDataSources;
Cube: IMetabaseObjectDescriptor;
Begin
MB := MetabaseClass.Active;
Expr := MB.ItemById("EXPRESS_REPORT").Edit As IEaxAnalyzer;
ExprDS := Expr.DataSources;
Cube := MB.ItemById("CUBE_1");
ExprDs.AddDescriptor(Cube);
(Expr As IMetabaseObject).Save;
End Sub Button1OnClick;
Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.Express;
Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
MB: IMetabase;
Expr: IEaxAnalyzer;
ExprDS: IEaxDataSources;
Cube: IMetabaseObjectDescriptor;
Begin
MB := Self.Metabase;
Expr := MB.ItemById["EXPRESS_REPORT"].Edit() As IEaxAnalyzer;
ExprDS := Expr.DataSources;
Cube := MB.ItemById["CUBE_1"];
ExprDs.AddDescriptor(Cube);
(Expr As IMetabaseObject).Save();
End Sub;
After executing the example clicking the button adds the CUBE_1 data source for the EXPRESS_REPORT express report.
See also: