使用poi读取excel文件Cannotgetatextvaluefromanumericcell

更新时间:2023-07-10 03:05:03 阅读: 评论:0

使⽤poi读取excel⽂件Cannotgetatextvaluefromanumericcell 我这样转换得到⼀个excel⽂本域的值
Cell cell = Cell(c);
最好的朋友英文cell.tCellType(Cell.CELL_TYPE_STRING);
有虞氏>背影的作者String parkName = StringCellValue();
某些时候,读取 excel ⽂件会出现如下错误
三国三十六计
java.lang.IllegalStateException: Cannot get a text value from a numeric cell
at org.apache.poi.hssf.peMismatch(HSSFCell.java:640)
在这⾥找到了解决⽅案
对我的原代码进⾏更改
DataFormatter formatter = new DataFormatter(); //creating formatter using the default locale
香港大营救Cell cell = Cell(c);
最美的什么作文
秋夕节String parkName = formatter.formatCellValue(cell); //Returns the formatted value of a cell as a String regardless of the cell type.
despite

本文发布于:2023-07-10 03:05:03,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/89/1075192.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:转换   背影   读取   错误   解决   更改   香港
相关文章
留言与评论(共有 0 条评论)
   
验证码:
推荐文章
排行榜
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图