You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Rob Y <ry...@yahoo.com> on 2009/01/19 18:39:17 UTC

wrapping text with newlines in merged cells

I'm trying to insert an arbitrary multiline comment string into an XLS row
and have bumped into a catch-22.

I originally tried merging a bunch of cells (all the defined columns in the
sheet for the row in question) and sticking the text into the first of them. 
The point is that I don't know how wide the text is, and I only want it to
wrap where there are explicit newline characters.

This 'works', in the sense that the text appears in the cell and wraps at
the newlines.  But I can't get Excel to auto-fit the row size to the text. 
Even when I click 'format cells', I don't get the alignment tab that would
allow me to view the 'wrap text' option.  If I manually resize the row, the
wrapping text displays fine.

So I tried it without the cell merge.  Now it sizes the row to display all
the text, but it wraps to the single cell width, which means it wraps to
more lines than requested by the newlines.

I also tried cell merge without 'wrap text'.  In that case, it just ignores
the newlines (displays them as 'bad character' glyphs).

So, is it possible to insert a big chunk of wrapping text into a big row and
get Excel to size the row so all the text displays?
-- 
View this message in context: http://www.nabble.com/wrapping-text-with-newlines-in-merged-cells-tp21547827p21547827.html
Sent from the POI - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org