![](/img/trans.png)
[英]The method getCellTypeEnum() is undefined for the type XSSFCell
[英]The method setCellType(int) from the type XSSFCell is deprecated
哪个是此弃用代码的替代方案?
cell.setCellType(XSSFCell.CELL_TYPE_NUMERIC);
//... cell is of XSSFCell type
我正在使用 Apache POI 3.17
'org.apache.poi.ss.usermodel.Cell.CELL_TYPE_NUMERIC' 已弃用。 改用'org.apache.poi.ss.usermodel.CellType.NUMERIC'。
// import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellType;
// tCell.setCellType(Cell.CELL_TYPE_NUMERIC); // <-- deprecated
setCellType(CellType.NUMERIC);
您可以使用org.apache.poi.ss.usermodel.Cell.CELL_TYPE_NUMERIC
如下类型:
setCellType(Cell.CELL_TYPE_NUMERIC);
希望这对你有帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.