You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Rajiv Poddar <ra...@gmail.com> on 2011/04/11 17:21:40 UTC

setting column to be test in XSSF

Hi,
 how to set a column format to be text while creating a Excel sheet using
POI 3.6.
What is happening here is that all cells of the column are formatted as text
if they have some data in them, all empty cells of that column are formatted
as 'general' by default rather than 'text'.

How can this be done?

Thanks n regards,
Rajiv

Re: setting column to be test in XSSF

Posted by Mark Beardsley <ma...@tiscali.co.uk>.
You would normally never bother setting the data type for an empty cell as
doing this requires you to create a record for each empty cell and that will
massivly increase the file size of the workbook. On a sheet there are
something like sixty five thousand rows and creating a record for each row
and each emty cell on that row will lead to a potentially bloated file and
slow your application somewhat.

Is there any reason why these empty cells must have their data type set?
When Excel marks a cell as 'General' that means it can accept any value and
when it is populated by the user, the application - Excel - will ensure that
features are automatically configured to suit the type of data the user is
entering. By this, I mean that numeric value will be right aligned, for
example, and I do not know that setting the data type to text will prevent
this from happening.

Yours

Mark B

--
View this message in context: http://apache-poi.1045710.n5.nabble.com/setting-column-to-be-test-in-XSSF-tp4296158p4297528.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