You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2005/03/05 00:49:37 UTC

DO NOT REPLY [Bug 16410] - Exception when using HSSFCell.setCellType to change cell type of existing cell

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=16410>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=16410


nirupakanthi@hotmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|WONTFIX                     |




------- Additional Comments From nirupakanthi@hotmail.com  2005-03-05 00:49 -------
I am trying to read an excel file. One of the columns in the file is a numeric 
type, it contains dates. I want to change the cell type to a String, so that i 
can get the data as it is seen on the sheet...for example, cell 1 as an value 
of '06/01/2003'. since cell 1 is numeric, i get a numeric value - which is 
37773.0, i am trying to set the cell type to String so that i can get the 
String as 06/01/2003

this is how i set the cell type of cell 1
row.getCell((short) colIndex).setCellType(1);

and this is how i try to get the string value
row.getCell((short) colIndex).getStringCellValue());

i get this error
java.lang.NumberFormatException: You cannot get a string value from a numeric 
ce
ll
        at org.apache.poi.hssf.usermodel.HSSFCell.getStringCellValue
(HSSFCell.ja
va:775)
        at org.apache.poi.hssf.usermodel.HSSFCell.setCellType
(HSSFCell.java:473)

        at org.apache.poi.hssf.usermodel.HSSFCell.setCellType
(HSSFCell.java:388)


thanks.
Nirupa Ravilla

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: poi-dev-unsubscribe@jakarta.apache.org
Mailing List:    http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta POI Project: http://jakarta.apache.org/poi/