web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

OutputStream write a newline

(0) ShareShare
ReportReport
Posted on by 20

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; 

*This post is locked for comments

I have the same question (0)
  • Verified answer
    SamCha Profile Picture
    20 on at

    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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans