| Author |
reading xlsx example issue
|
sai rama krishna
Ranch Hand
Joined: May 29, 2009
Posts: 133
|
|
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: 3036
|
|
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: 133
|
|
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
|
 |
 |
|
|
subject: reading xlsx example issue
|
|
|