1
回答
poi组件导入excel表格 疑问
滴滴云服务器,限时包月0.9元,为开发者而生>>>   
private void importExcel(String fileName) throws Exception {
        InputStream myxls = new FileInputStream(fileName);
        HSSFWorkbook book = new HSSFWorkbook(myxls);
        FormulaEvaluator eval = book.getCreationHelper().createFormulaEvaluator();
//
提示  The method getCreationHelper() is undefined for the type HSSFWorkbook

        HSSFSheet sheet = book.getSheetAt(0);
        if (importInputForm.isHeaderSelected()) {
            sheet.removeRow(sheet.getRow(0));
        }
        for (Row row : sheet) {        //
提示 sheet 那里出错Can only iterate over an array or an instance of java.lang.Iterable

            String[] line = new String[16];
            int i = 0;
            for (Cell cell : row) {
                line[i] = getCellContent(cell, eval);
                i++;
            }
            insertData(line);
        }
        myxls.close();
    }
求解答!!!!
POI
举报
YYxlid
发帖于5年前 1回/447阅
顶部