EtlObject: Object;
The EtlObject property determines ETL task object that has a corresponding graphic object.
Sub Main;
Var
MB: IMetabase;
MbObj: IMetabaseObject;
EtlTask: IEtlTask;
EtlProvider: IEtlPlainDataProvider;
ExcelProvider: IDtExcelProvider;
WxConsumer : IWxRectangle;
WxETLConsumer : IWxEtlObject;
Begin
MB:=MetabaseClass.Active;
//ETL task search. Repository object with the ETL identifier
MbObj:=MB.ItemById("ETL").Edit;
EtlTask:=MbObj As IEtlTask;
//Beginning of Excel source creation
//Creation of an object Import from Excel
EtlProvider:=EtlTask.Create(EtlObjectType.PlainDataExcelProvider) As IEtlPlainDataProvider;
EtlProvider:= EtlProvider.Edit;
EtlProvider.Id:= "File_XLS";
EtlProvider.Name:= "Data source XLS";
EtlProvider.Description:="Data from file data.xls";
//Configuration of data source
ExcelProvider := EtlProvider.Provider As IDtExcelProvider;
ExcelProvider.File:= "c:\data.xls" ;
ExcelProvider.DriverVersion:= "Excel 8.0";
ExcelProvider.Query :="select * from [Sheet1$]";
ExcelProvider.HasHeader:=False;
EtlProvider.FillDefault;
//Save Excel source
EtlProvider.Save;
//End of Excel source creation
//Beginning 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 repository object
MbObj.Save;
End Sub Main;
After executing the example, the Import from Excel object with the FILE_XLS identifier is created in the ETL task, data is taken from the file c:\data.xls. After creating the object, a graphic object is created to display the object on the ETL task workspace.
See also: