In our use case, there is a sheet with one column for postal codes. If user
enters '01234' in that column, then by default, excel removes the leading 0
and puts as '1234' because the default formatting of the column/cell is
'general'. If we can pre-format the cell type to be 'text', then data
entered by the user won't be automatically changed.
Please let me know if there is a way to do this.

Thanks n regards,
Rajiv


On Tue, Apr 12, 2011 at 12:18 PM, Mark Beardsley
<[email protected]>wrote:

> 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: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to