IDtMetabaseProvider.Dataset

Syntax

Dataset: IDatasetModel;

Description

The Dataset property determines repository relational object with which this data provider is connected.

Example

Executing the example requires that the repository contains an ETL task with the Etl identifier and a table with the Table_1 identifier.

Sub Main;

Var

MB: IMetabase;

MObj: IMetabaseObject;

EtlTask: IEtlTask;

EtlProvider: IEtlPlainDataProvider;

MBProvider: IDtMetabaseProvider;

WxConsumer: IWxRectangle;

WxETLConsumer: IWxETLObject;

Begin

MB := MetabaseClass.Active;

//ETL task search. Repository object with the ETL identifier

MObj := MB.ItemById("Etl").Edit;

EtlTask := MObj As IEtlTask;

//Start of the provider creation

//The Repository Provider object creation

EtlProvider := EtlTask.Create(EtlObjectType.PlainDataMetabaseProvider) As IEtlPlainDataProvider;

EtlProvider := EtlProvider.Edit;

EtlProvider.Id := "MB_Provider";

EtlProvider.Name := "Repository data provider";

EtlProvider.Description := "Data from the table Table_1";

//Set up data provider

MBProvider := EtlProvider.Provider As IDtMetabaseProvider;

MBProvider.Dataset := MB.ItemById("Table_1").Bind As IDatasetModel;

EtlProvider.FillDefault;

//Save provider

EtlProvider.Save;

//End of provider creation

//Start of visual object creation

WxConsumer := EtlTask.Workspace.CreateRectangle;

WxETLConsumer := New WxETLObject.Create;

WxETLConsumer.ETLObject := EtlProvider;

WxConsumer.Style.TextPosition := WxTextPosition.Bottom;

WxConsumer.Style.PictureMarginTop := -10;

WxConsumer.PinPosition := New GxPointF.Create(50, 50);

WxConsumer.Extension := WxETLConsumer As IWxShapeExtension;

//End of visual object creation

//Save Etl task

MObj.Save;

End Sub Main;

After executing this example the Repository Provider object is created in the ETL task. The provider is connected with the Table_1 repository table.

See also:

IDtMetabaseProvider