Home
Analytics
New line character within a cell in Excel
Edd
Hi,<br />
<br />
I have integrated BIRT into an existing web application (currently we are using 2.6) and we have added options to export the report using HTML, PDF and Excel (all using the standard emitters).<br />
<br />
My question:<br />
<br />
How do I get data to appear all in one cell of an Excel file but on multiple lines?<br />
<br />
So currently I have, for example a report with one row of data where one of the columns contains data that is ideally spread across multiple lines. In HTML I am able to to this by including the <br /> tag but in Excel that results in my one row becoming as many rows as there are occurances of the <br/> tag. This is what I might get in HTML:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
Col1 | Col2
ed | some data
| more data
</pre>
<br />
where the raw data in 'Col2' is "some data<br/>more data" and contained within a dynamic text BIRT component.<br />
In Excel, without modifying the raw data I get a worksheet like this:<br />
<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
Col1 | Col2
ed | some data
| more data
</pre>
<br />
I have tried changing the raw data value for the excel export so that '<br />' tags are replaced with '\n\r' but that didn't work...any ideas?<br />
<br />
Thanks in advance
Find more posts tagged with
Comments
JasonW
Can you set the row height and then use a dynamic text element instead of a data item. Look at the attached exmaple.
Jason
JasonW
example report
Edd
Thanks for the reply and the demo, though I think your example is slightly different...in that the text in your demo that appears on multiple lines in an excel file just wraps within the cell. I can't see any forced new lines in the text (i.e. new paragraphs), though I may have just missed them(?).
Currently I am using the dynamic text component to render the data, any way to force a new line in the data contained within the one cell without resulting in multiple rows for the one data row in excel?
Thanks again
JasonW
Can you log an enhancement request for this?
Jason