Options

How to Import CSV Using XMLPort with parameter taken from User ?

Hello
I am trying to import CSV file using XMLPort with some user defined parameter
UserParameter is 'EmplyeeName'
EmplyeeName:= 'Text'

When i use
File.OPEN(FilePath + FileRec.Name);
File.CREATEINSTREAM(FileInStream);
XMLPORT.IMPORT(50031,FileInStream );
File.CLOSE;
How can i pass EmployeeName to XMLPort ?

Answers

  • Options
    RockWithNAVRockWithNAV Member Posts: 1,139
    Instead of XmlPort use the xmlport variable of that xmlport as reference then use it,

    File.OPEN(FilePath + FileRec.Name);
    File.CREATEINSTREAM(FileInStream);
    X.Setvalue(Employeename);
    X.Setsource(FileInStream);
    X.Import;
    File.CLOSE;

    X is the variable of that xmlport
    Setvalue is the new function in xmlport. pass emplyeename as parameter


    Setvalue
    GetValue := Employeename;

    GetValue is a Global Variable
    Apply this filter on PreXmlport.

    You are good to go now.
Sign In or Register to comment.