IDtTextConsumer.TextCodePage

Syntax

TextCodePage: CodePage;

Description

The TextCodePage property determines the encoding used on data export to file.

Comments

To determine the file, to which data is exported, use the IDtTextConsumer.File property.

Example

Executing the example requires that repository contains an ETL task with the ETL identifier and the C:\Data.txt text file.

Add links to the Metabase, Etl, Dt, Andy, Drawing system assemblies.

Sub UserProc;
Var
    MB: IMetabase;
    EtlTask: IEtlTask;
    EtlConsumer: IEtlPlainDataConsumer;
    TextConsumer: IDtTextConsumer;
    WxConsumer: IWxRectangle;
    WxETLConsumer: IWxETLObject;
Begin
    MB := MetabaseClass.Active;
    EtlTask := MB.ItemById("ETL").Edit As IEtlTask;
    //Create the Export to Text object
    EtlConsumer := EtlTask.Create(EtlObjectType.PlainDataTextConsumer) As IEtlPlainDataConsumer;
    EtlConsumer := EtlConsumer.Edit;
    EtlConsumer.Id := "Text_Consumer";
    EtlConsumer.Name := "Export in text";
    EtlConsumer.Description := "Export in text";
    //Set up data consumer
    TextConsumer := EtlConsumer.Consumer As IDtTextConsumer;
    TextConsumer.File := "C:\Data_out.txt";
    TextConsumer.WriteHeader := True;
    TextConsumer.RowDelimiter := "|";
    TextConsumer.DelimitedColumnDelimiter := ";";
    TextConsumer.DelimitedTextQualifier := "'";
    TextConsumer.TextCodePage := CodePage.UTF7;
    EtlConsumer.FillDefault;
    //Save consumer
    EtlConsumer.Save;
    //Create a visual object 
    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;
    //Save Etl task
    (EtlTask As IMetabaseObject).Save;
End Sub UserProc;

After executing the example the Export to text object is created in the ETL task. The object will export data to the C:\Data.txt text file with specified settings:

See also:

IDtTextConsumer