Apache OpenOffice (AOO) Bugzilla – Issue 18302
Allow insertion of newline in a cell using a formula
Last modified: 2013-08-07 15:13:47 UTC
Hello. I would like to use =CONCATENATE(A1+2;<code for newline>; B2-4) in a cell, where <code for newline> means that the text that is printed in the cell has a newline in it (i.e printed on two rows). Is it possible with 1.1RC3 ? If not, it would be a nice thing to have for some tasks.
Hi Bettina, 1 4 u. Frank
If there was one, it probably would be by using CHAR(13) or similar. (but this doesn't work right now) reassigning, setting keywords according to new RFE-process original summary: "newline in cell" There should be a way to insert a manual break into a cell using a formula. You can insert a manual break by pressing <ctrl>+<enter> but using CHAR(13) is converted to a regular space. running CODE() on a cell containing a manually inserted break at the beginning returns "32" (=regular space) as well. The textfunctions should be enhanced so that they can handle linebreaks as well.
*** Issue 41428 has been marked as a duplicate of this issue. ***
*** Issue 61753 has been marked as a duplicate of this issue. ***
*** Issue 59970 has been marked as a duplicate of this issue. ***
I found that &CHAR(10) sometimes works. But I found no difference within the cases that worked and those that don't. If somebody needs an example, I can send a sxc-file. In this file I copied the formula to a couple of lines and in some lines I've the breaks and in other lines I've something like a special character between the strings that should be seperatet by the break. To contact me: claudia.drechsle@yahoo.de
I found, when Calc accepts CHAR(10) as line-break: When the result-string is smaller than the result-cell, Calc does not insert a line-break When the result-string is wider than the result-cell, then Calc does not wrap the text automatically but inserts line-break at exactly the points that are marked by CHAR(10). So it seems, as if Calc recognizes CHAR(10) but in the case of text that is smaller than the cell the normally text-flow has a higher prioritxy. Claudia
Created attachment 37656 [details] line breaks in formulas
some further observations using OOO-2.0.3 try the following: 1.) put "A" in A1, "B" in B1, "C" in C1 2.) in D1 insert formula =A1&CHAR(10)&B1&CHAR(10)&C1 Content of D1 looks like "ABC" now copy D1 and paste into a Text editor (SciTe used here): You get A B C so the breaks are there in the Calc data! to get Calc show the breaks continue 3. format D1 like: "Format Cells => Alignment => Wrap text automatically" 4. make column D smaller until letter "C" seems to get cut off: rendered text gets split into three lines voila :) seems like the break is there but just not rendered correctly in the Calc Cell Jens
Considering the last comments to this issue, it seems to me, that the issue type should not be "feature" but "defect". Claudia
I have the same opinion of Claudia, propose to change to defect
Please transfer your votes to issue 35913. *** This issue has been marked as a duplicate of 35913 ***
Closing dup.
I found that the situation has worsend. In OOo 2.3 the &CHAR(10)- tip doesn't work even when the cell is smaller than the sring before the CHAR-function.