Skip to Content
avatar image
Former Member

How to display newline(cl_abap_char_utilities=>newline) using XML?

I have concern regarding the use of cl_abap_char_utilities=>newline converted to XML.

the newline (ALT+Enter) in a cell is not displayed in the excel attachment. instead it is viewed as:

"text1, text2".

I was hoping the resulting output in a particular cell would be:

text1

text2

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Sep 27, 2017 at 11:47 AM

    Based on your latest comments, you are using XMLSS, not OLE (and you are generating XMLSS via the ABAP iXML classes). In XML, all "space-like" characters (space, newline, tab...) are interpreted by default as one space. If you want to pass the actual values, you must use their equivalent "character entity references":

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 27, 2017 at 06:14 AM

    Did you set the cell's IsTextWrapped style to true

    worksheet.Cell.Style.WrapText=true;
    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Raymond Giuseppi

      HI Raymond Giuseppi, I have tried this. But I'm still not getting the expected output. The character entity reference for newline ( & #10;) is still not interpreted properly. But it's ok, I think I found the approach i'm looking for. Thank you.