POI 解析 Excel
File[] files = hFileEntity.getAttach();
is = new FileInputStream(files[0]);
Workbook wb = null;
try {
wb = new XSSFWorkbook(files[0].getAbsolutePath());//解析excel2007以上的
} catch (Exception e) {
POIFSFileSystem fs = new POIFSFileSystem(is);//解析excel2003的
wb = new HSSFWorkbook(fs);
}
Sheet rs = (Sheet) wb.getSheetAt(0);
rs.getLastRowNum()//从0开始计行数
Row firstRow = rs.getRow(0);
firstRow.getLastCellNum()//从1开始计列数