You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by shankarrao <sh...@gmail.com> on 2011/01/25 15:26:40 UTC
Dollar Symbol not shown in the workbook
I have my cellStyle defined for displaying the Currency in dollar Format as
follows:
CellStyle dollarFormat = workbook.createCellStyle();
dollarFormat.setDataFormat(format.getFormat("$ ###,###,##0"));
However in the displayed workbook, i am not seeing the dollar symbol
displayed. Could you please assist me in knowing what am i missing in this?
Thanks for your help!
Shankar
--
View this message in context: http://apache-poi.1045710.n5.nabble.com/Dollar-Symbol-not-shown-in-the-workbook-tp3356326p3356326.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: Dollar Symbol not shown in the workbook
Posted by shankarrao <sh...@gmail.com>.
Got it working now! The issue was that i was trying to assign the currency
format to a cell with String value in it. Thanks for your inputs, Nick.
-Shankar
--
View this message in context: http://apache-poi.1045710.n5.nabble.com/Dollar-Symbol-not-shown-in-the-workbook-tp3356326p3359330.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: Dollar Symbol not shown in the workbook
Posted by Nick Burch <ni...@alfresco.com>.
On Tue, 25 Jan 2011, shankarrao wrote:
> If i save the file and re-open it in POI, the cell doesn't have the
> correct format in it. It shows the default format of Excel.
Looks like you're not correctly applying the style then. Maybe use a
debugger and ensure all your objects are as you expect, and not null?
Nick
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org
Re: Dollar Symbol not shown in the workbook
Posted by shankarrao <sh...@gmail.com>.
Hi Nick,
If i save the file and re-open it in POI, the cell doesn't have the correct
format in it. It shows the default format of Excel.
-Shankar
--
View this message in context: http://apache-poi.1045710.n5.nabble.com/Dollar-Symbol-not-shown-in-the-workbook-tp3356326p3356473.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: Dollar Symbol not shown in the workbook
Posted by Nick Burch <ni...@alfresco.com>.
On Tue, 25 Jan 2011, shankarrao wrote:
> Sorry.. I forgot to include it in the posted code snippet. I am doing that
> but still not able to see the cell value with a dollar symbol.
> CellUtil.createCell(rowParameter,col,"Test",dollarFormat);
If you save the file and re-open it in POI, does your cell have the
correct format? When you open the file in excel, what format does excel
think is applied?
Nick
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org
Re: Dollar Symbol not shown in the workbook
Posted by shankarrao <sh...@gmail.com>.
Nick,
Sorry.. I forgot to include it in the posted code snippet. I am doing that
but still not able to see the cell value with a dollar symbol.
CellUtil.createCell(rowParameter,col,"Test",dollarFormat);
-Shankar
--
View this message in context: http://apache-poi.1045710.n5.nabble.com/Dollar-Symbol-not-shown-in-the-workbook-tp3356326p3356366.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: Dollar Symbol not shown in the workbook
Posted by Nick Burch <ni...@alfresco.com>.
On Tue, 25 Jan 2011, shankarrao wrote:
> I have my cellStyle defined for displaying the Currency in dollar Format as
> follows:
> CellStyle dollarFormat = workbook.createCellStyle();
> dollarFormat.setDataFormat(format.getFormat("$ ###,###,##0"));
>
> However in the displayed workbook, i am not seeing the dollar symbol
> displayed.
You need to assign the style to a cell before it applies, which seems to
be missing from your code snippet
Nick
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org