AddDescriptor (Desc: IMetabaseObjectDescriptor) : IEaxDataSource;
AddDescriptor (Desc: Prognoz.Platform.Interop.Metabase.IMetabaseObjectDescriptor) : Prognoz.Platform.Interop.Express.IEaxDataSource;
The AddDescriptor method adds a data source to express report.
Executing the example requires the button named Button1, the express report with the EXPRESS_REPORT identifier and the 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;
After executing the example clicking the button adds the CUBE_1 data source for the EXPRESS_REPORT express report.
The requirements and result of the Fore.NET Example execution match with those in the Fore Example. Instead of the Fore components use their Fore.NET analogs.
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;
See also: