IDtXmlConsumer.File

Syntax

File: String;

Description

The File property determines the path and the name of the text file, in which the data is exported.

Example

Executing the example requires that the repository contains an ETL task with the ETL identifier.

Sub UserProc;
Var
    MB: IMetabase;
    MObj: IMetabaseObject;
    EtlTask: IEtlTask;
    EtlConsumer: IEtlPlainDataConsumer;
    XMLConsumer: IDtXmlConsumer;
    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 creating a data consumer
    // Create the "Export to XML" object
    EtlConsumer := EtlTask.Create(EtlObjectType.PlainDataXmlConsumer) As IEtlPlainDataConsumer;
    EtlConsumer := EtlConsumer.Edit;
    EtlConsumer.Id := "XML_Consumer";
    EtlConsumer.Name := "Export to XML";
    EtlConsumer.Description := "Export to XML";
    // Set up data consumer
    XMLConsumer := EtlConsumer.Consumer As IDtXmlConsumer;
    XMLConsumer.DataNodeName := "Row";
    XMLConsumer.File := "c:\Data_out.Xml";
    XMLConsumer.FormatType := DtXmlFormatType.FieldsAsNodes;
    XMLConsumer.RootNodeName := "Data";
    // Save data consumer
    EtlConsumer.Save;
    // End of creating a data consumer
    // Start of visual object creation
    WxConsumer := EtlTask.Workspace.CreateRectangle;
    WxETLConsumer := New WxETLObject.Create;
    WxETLConsumer.ETLObject := EtlConsumer;
    WxConsumer.Style.TextPosition := WxTextPosition.Bottom;
    WxConsumer.Style.PictureMarginTop := -10;
    WxConsumer.PinPosition := New GxPointF.Create(5050);
    WxConsumer.Extension := WxETLConsumer As IWxShapeExtension;
    // End of visual object creation
    // Save ETL task
    MObj.Save;
End Sub UserProc;

After executing the example the Export to XML object is created in the ETL task. This data consumer exports data to the Data_out.xml file. If the file does not exist, it will be created.

During export the file turns into:

<Data>

<Row>

<I_FIELD>10</I_FIELD>

<D_FIELD>10.4</D_FIELD>

<S_FIELD>A</S_FIELD>

<DATE_FIELD>01.01.2006</DATE_FIELD>

<B_FIELD>0</B_FIELD>

</Row>

<Row>

<I_FIELD>20</I_FIELD>

<D_FIELD>24.4</D_FIELD>

<S_FIELD>B</S_FIELD>

<DATE_FIELD>01.02.2006</DATE_FIELD>

<B_FIELD>1</B_FIELD>

</Row>

....

</Data>

See also:

IDtXmlConsumer