b1412 / jfinal-ext

Our extensions for jfinal
277 stars 236 forks source link

ExcelTools 使用了不兼容2007的API #13

Closed zqjimlove closed 9 years ago

zqjimlove commented 10 years ago
try {
            fis = new FileInputStream(file);
            hwb = new HSSFWorkbook(fis);
        } catch (Exception e) {
            logger.error("create excel error", e);
            return Maps.newHashMap();
        }

建议改成

 Workbook hwb = null;
 try {
            fis = new FileInputStream(file);
//兼容2003和2007
            hwb = WorkbookFactory.create(fis);
        } catch (Exception e) {
            logger.error("create excel error", e);
            return Maps.newHashMap();
        }
b1412 commented 10 years ago

Ok,下一版本修复