File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes reading xlsx example issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "reading xlsx example issue" Watch "reading xlsx example issue" New topic
Author

reading xlsx example issue

sai rama krishna
Ranch Hand

Joined: May 29, 2009
Posts: 283


I was trying above example from link


http://techtadka.net/articles/programming/208-code-for-reading-a-xlsx-file-in-java.html


using attached cccc.xlsx.

I am getting following error. Please advise
number of rows---->1
java.lang.IllegalStateException: Cannot get a text value from a numeric cell
at org.apache.poi.xssf.usermodel.XSSFCell.typeMismatch(XSSFCell.java:845)
at org.apache.poi.xssf.usermodel.XSSFCell.getRichStringCellValue(XSSFCell.java:294)
at org.apache.poi.xssf.usermodel.XSSFCell.getStringCellValue(XSSFCell.java:246)
at sssssssss.ReadSheet(sssssssss.java:60)
at sssssssss.main(sssssssss.java:98)





Any ideas, suggestions, sample code, links, source code highly appreciated. Thanks in advance
Steve Luke
Bartender

Joined: Jan 28, 2003
Posts: 4181
    
  21

java.lang.IllegalStateException: Cannot get a text value from a numeric cell

You have a value which is a Number. You try to get text from it. You should instead try to get a Number from it.


Steve
sai rama krishna
Ranch Hand

Joined: May 29, 2009
Posts: 283


I changed like above now able to read only few values not all as below

number of rows---->1
aa
77-SS_001
DONE
aa
77-SS_002
NoDONE


>>You should instead try to get a Number from it.

How to get Number instead of string. Please advise
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: reading xlsx example issue