Nothing about the other replies you may have gotten but they are way off the
mark.  You need to set the cell style for the cell with option of text to be
wrapped.

Here is an example from code that I wrote about a year ago that had the same
problem:

HssfCellStyle wrap = book.createCellStyle();

wrap.setFont(font);

wrap.setWrapText(true);

 

and then when I put the text in the cell,

cell.setCellValue(remark);

cell.setCellStyle(wrap);

 

What is happening is that it does not know that it needs to wrap the text if
so it doesn't know what the carriage return character should look like.  

Shawn

 

http://jakarta.apache.org/poi/apidocs/org/apache/poi/hssf/usermodel/HSSFCell
Style.html#setWrapText(boolean)

 

  _____  

From: iansdev [mailto:[EMAIL PROTECTED] 
Sent: Monday, December 08, 2003 3:42 AM
To: [EMAIL PROTECTED]
Subject: POI line feed/Carriage Return Problem

 


Hi! 

I can anyone help with these..

 

Using POI. i have a problem writing a data on excel  with line feed/Carriage
Return (data is from a Oracle datable) it seems that it doen't recognized
the line feed/Carriage Return (it replaces with square thing)..

 

Can anyone help me..

 

 

Thanks in Advance,

 

Caezar Ian Santilla

Web Developer

6/F Alpap I Bldg., 140 L.P. Leviste St.

Salcedo Village, Makati City

Manila, Philippines

Tel:  +63 (0) 2 751 7010 - ext 112

Fax: +63 (0) 2 751 7013

Email: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> 



 

 

 

____________________________________________________
 <http://www.incredimail.com/redir.asp?ad_id=309&lang=9>   IncrediMail -
Email has finally evolved -
<http://www.incredimail.com/redir.asp?ad_id=309&lang=9> Click Here

Reply via email to