You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Anjishnu Bandyopadhyay <an...@infosys.com> on 2007/04/04 07:58:35 UTC

Auto fit of cell values in MS Excel

Hi all,

 

I am generating an MS Excel sheet through POI.

For a column in the sheet, I am specifying a width by using the method
"setColumnWidth()". Now, if the content of the cell is more, then,
portions of the value in the cell are hidden. Is it possible to break
the contents to the next line programmatically (the same effect that can
be achieved by pressing "Alt+Enter")?

 

Thanks for your time.

 

With best regards,

Anjishnu.

 



**************** CAUTION - Disclaimer *****************
This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system.
***INFOSYS******** End of Disclaimer ********INFOSYS***

Re[2]: Auto fit height of cell values in MS Excel

Posted by Yegor Kozlov <ye...@dinom.ru>.
Hi,

You should turn on word wrapping.
Create a cell style with setWrapText(true) and assign it to the cell.

Yegor

AB> Hi all,

 

AB> Actually, I intend to make the height to fit the value of the cell.

 

AB> With best regards,

AB> Anjishnu.

 

AB> -----Original Message-----
AB> From: Anjishnu Bandyopadhyay [mailto:anjishnu_b@infosys.com] 
AB> Sent: Wednesday, April 04, 2007 11:29 AM
AB> To: poi-user@jakarta.apache.org
AB> Subject: Auto fit of cell values in MS Excel

 

 

AB> Hi all,

 

 

 

AB> I am generating an MS Excel sheet through POI.

 

AB> For a column in the sheet, I am specifying a width by using the method

AB> "setColumnWidth()". Now, if the content of the cell is more, then,

AB> portions of the value in the cell are hidden. Is it possible to break

AB> the contents to the next line programmatically (the same effect that can

AB> be achieved by pressing "Alt+Enter")?

 

 

 

AB> Thanks for your time.

 

 

 

AB> With best regards,

 

AB> Anjishnu.

 

 

 

 

 

AB> **************** CAUTION - Disclaimer *****************

AB> This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended
AB> solely for the use of the addressee(s). If you are not the intended
AB> recipient, please notify the sender by e-mail and delete the original
AB> message. Further, you are not to copy, disclose, or distribute this
AB> e-mail or its contents to any other person and any such actions are
AB> unlawful. This e-mail may contain viruses. Infosys has taken every
AB> reasonable precaution to minimize this risk, but is not liable for any
AB> damage you may sustain as a result of any virus in this e-mail. You
AB> should carry out your own virus checks before opening the e-mail or
AB> attachment. Infosys reserves the right to monitor and review the content
AB> of all messages sent to or from this e-mail address. Messages sent to or
AB> from this e-mail address may be stored on the Infosys e-mail system.

AB> ***INFOSYS******** End of Disclaimer ********INFOSYS***


---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/


RE: Auto fit height of cell values in MS Excel

Posted by Anjishnu Bandyopadhyay <an...@infosys.com>.
Hi all,

 

Actually, I intend to make the height to fit the value of the cell.

 

With best regards,

Anjishnu.

 

-----Original Message-----
From: Anjishnu Bandyopadhyay [mailto:anjishnu_b@infosys.com] 
Sent: Wednesday, April 04, 2007 11:29 AM
To: poi-user@jakarta.apache.org
Subject: Auto fit of cell values in MS Excel

 

 

Hi all,

 

 

 

I am generating an MS Excel sheet through POI.

 

For a column in the sheet, I am specifying a width by using the method

"setColumnWidth()". Now, if the content of the cell is more, then,

portions of the value in the cell are hidden. Is it possible to break

the contents to the next line programmatically (the same effect that can

be achieved by pressing "Alt+Enter")?

 

 

 

Thanks for your time.

 

 

 

With best regards,

 

Anjishnu.

 

 

 

 

 

**************** CAUTION - Disclaimer *****************

This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended
solely for the use of the addressee(s). If you are not the intended
recipient, please notify the sender by e-mail and delete the original
message. Further, you are not to copy, disclose, or distribute this
e-mail or its contents to any other person and any such actions are
unlawful. This e-mail may contain viruses. Infosys has taken every
reasonable precaution to minimize this risk, but is not liable for any
damage you may sustain as a result of any virus in this e-mail. You
should carry out your own virus checks before opening the e-mail or
attachment. Infosys reserves the right to monitor and review the content
of all messages sent to or from this e-mail address. Messages sent to or
from this e-mail address may be stored on the Infosys e-mail system.

***INFOSYS******** End of Disclaimer ********INFOSYS***