Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV forum
Answered

OutputStream write a newline

Posted on by 2

I am trying to add a newline between XMLPorts, but I either get no newline or I get a space added at the beginning of the newline.

Here the current code, the newline woks but I get an empty space character at the beginning of the new line.

If I remove one of the two character form the CRLF, the newline doesn't work.

txtCRLF := 'XX';
txtCRLF[1] := 13;
txtCRLF[2] := 10;

exportFile.CREATE('payment.txt');  
exportFile.CREATEOUTSTREAM(exportOutput);  
XMLPORT.EXPORT(XMLPORT::"Payment Export Header", exportOutput);
exportOutput.WRITE(txtCRLF);
XMLPORT.EXPORT(XMLPORT::"Payment Export Batch", exportOutput);
exportOutput.WRITE(txtCRLF);
XMLPORT.EXPORT(XMLPORT::"Payment Export Payment", exportOutput);
exportFile.CLOSE; 
  • Verified answer
    SamCha Profile Picture
    SamCha 2 on at
    RE: OutputStream write a newline

    Got it working with exportOutput.WRITETEXT();

    exportFile.CREATE('payment.txt');  
    exportFile.CREATEOUTSTREAM(exportOutput);  
    XMLPORT.EXPORT(XMLPORT::"Payment Export Header", exportOutput);
    exportOutput.WRITETEXT();
    XMLPORT.EXPORT(XMLPORT::"Payment Export Batch", exportOutput);
    exportOutput.WRITETEXT();
    XMLPORT.EXPORT(XMLPORT::"Payment Export Payment", exportOutput);
    exportFile.CLOSE; 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,537 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,520 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans