首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 其他教程 > 开源软件 >

poi简单读取excel内容格式有关问题

2012-06-27 
poi简单读取excel内容格式问题对应的类型有对应的值如何判断,方法如下:cell.getCellType()获取对应格式的

poi简单读取excel内容格式问题

对应的类型有对应的值如何判断,方法如下:
cell.getCellType()
获取对应格式的值(int)。对比上面的可知道是什么类型的。

                        // 时间,整形,字符串// 第一列 时间HSSFCell cell = sheet.getRow(rowIndex).getCell(0);Date date = cell.getDateCellValue();// 第二列 整形cell = sheet.getRow(rowIndex).getCell(1);int number = (int) cell.getNumericCellValue();// 第三列 字符串cell = sheet.getRow(rowIndex).getCell(2);String str = cell.getStringCellValue();

热点排行