You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Aakeef <sa...@gmail.com> on 2013/12/20 06:25:29 UTC

Setting the cell type to “numeric” for an entire column

I'm Creating excel and writting the data into excel(.xlsx) as String list.

i want to set few columns data fromat as Number/Numeric.

textStyle.setDataFormat(fmt.getFormat("@"));
sheet.setDefaultColumnStyle(12, textStyle);

What would be the Syntax for Number/Numeric??

Thanks
Aakeef 



--
View this message in context: http://apache-poi.1045710.n5.nabble.com/Setting-the-cell-type-to-numeric-for-an-entire-column-tp5714477.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


Re: Setting the cell type to “numeric” for an entire column

Posted by Nick Burch <ap...@gagravarr.org>.
On Thu, 19 Dec 2013, Aakeef wrote:
> I'm Creating excel and writting the data into excel(.xlsx) as String list.
>
> i want to set few columns data fromat as Number/Numeric.

BuiltinFormats has the list of all the standard formats

Generally the simplest way to work out what format string to use is to 
format a cell in excel how you want it, then read that back in POI and see 
what actually got written to the file

Nick

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