Have you tried

this.styleKg.setDataFormat(wb.createDataFormat().getFormat("#,##000
\'kg\'"));

or

this.styleKg.setDataFormat(wb.createDataFormat().getFormat("#,##000 kg"));

or even

this.styleKg.setDataFormat(wb.createDataFormat().getFormat("#,##000kg")); 

just to see if the problem has to do with the single inverted commas
surrounding the units symbol? Have no idea if this will help at all, sorry.

Yours

Mark B


Princess-4 wrote:
> 
> this.styleKg.setDataFormat(wb.createDataFormat().getFormat("#,##000
> 'kg'"));
> 
> 
> is not setting the format in the cell with POI 2.5 .basically i want 1000
> Kg
> to be written in the cell
> along with the unit.
> 
> The same user defined format works in Excel..
> 
> But to display %
> this.stylePer.setDataFormat(wb.createDataFormat().getFormat("0.00%")); is
> working
> 
> thanks
> 
> 

-- 
View this message in context: 
http://old.nabble.com/Units-to-be-set-through-getFormat%28%29-tp27271302p27273826.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