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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

OutputStream write a newline

(0) ShareShare
ReportReport
Posted on by 18

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
    18 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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

#1
HoangNam Profile Picture

HoangNam 7

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans