IDtDocument.Document

Syntax

Document: IMetabaseObjectDescriptor;

Description

The Document property determines theDocument repository object, from which data is imported.

Comments

A source for data import from the Document repository object can be chosen from the following:

Example

Executing the example requires an ETL task with the ETL identifier and a document with the DOCPROVIDER identifier that is a data source.

To display process and result of data import in the console window, the CallBack class, described in example of the IEtlExecutionCallback.OnObject.

Add links to the Metabase, ETL, and Dt system assemblies.

Sub UserProc;
Var
    mb:IMetabase;
    EtlTask: IEtlTask;
    EtlProvider:IEtlPlainDataProvider;
    CB: CallBack;
    TextProvider : IDtTextProvider;
    DocumentProvider : IDtDocument;
Begin
    mb:=MetabaseClass.Active;
    EtlTask:=mb.ItemById("ETL").Edit As IEtlTask;
    //Create the Import from Text object
    EtlProvider := EtlTask.Create(EtlObjectType.PlainDataTextProvider) As IEtlPlainDataProvider;
    EtlProvider := EtlProvider.Edit;
    EtlProvider.Id := "Text_Provider";
    EtlProvider.Name := "Import from Text";
    EtlProvider.Description := "Import from Text";
    //Set up data source
    TextProvider := EtlProvider.Provider As IDtTextProvider;
    CB:=New CallBack.Create;
    EtlTask.Execute(CB);
    DocumentProvider := TextProvider As IDtDocument;
    If DocumentProvider <> Null Then
        DocumentProvider.Document := MB.ItemById("DOCPROVIDER");
    End If;
    (EtlTask As IMetabaseObject).Save;
End Sub UserProc;

After executing the example data is loaded from the specified document.

See also:

IDtDocument | TheRepository Data Source