It's all about the answers!

Ask a question

RPE Excel - Attribute with multiple lines (carriage returns)


Glyn Costello (1047) | asked Jul 22 '21, 8:18 a.m.

 Hi, 


when using RPE to export requirements, some attributes in the datasource are multi-line. The XML datasource uses &#10 to identify a new line, but in the excel output this is ignored and the result is a all lines combined into a single line (with no escape characters).

One answer



permanent link
Bartosz Chrabski (3.3k12245) | answered Jul 22 '21, 8:26 a.m.

 Hi Glyn,


If You will add String.fromCharCode(10); at the end of the line and it will encode new line proper way.

Just do text+"String.fromCharCode(10);

Hope it is solving Your problem.

Bartek


Comments
Glyn Costello commented Jul 22 '21, 11:10 a.m.

 Just to double check... 


The attribute value in the datasource is

"Here is line one&#10Here is line two"

I want to it to print in my Excel as 

Here is line one
Here is line two


Bartosz Chrabski commented Jul 22 '21, 11:58 a.m.
Try is

text.replace("&#10", String.fromCharCode(10));

Your answer


Register or to post your answer.