无法使用POI java从e​​xcel读取下拉列表值

时间:2017-06-06 11:29:58

标签: java apache-poi

enter image description here

我无法读取单元公司代码的数据及其下拉值。我尝试使用

读取数据

尝试{

        Workbook wb = new XSSFWorkbook(new FileInputStream(
                "D:/TCA/Test/test.xlsx"));
        // org.apache.poi.ss.usermodel.Workbook wb = new XSSFWorkbook(new
        // FileInputStream("D:/TCA/Test/aa.xlsx"));
        for (int i = 0; i < wb.getNumberOfSheets(); i++) {
            Sheet sheet = wb.getSheetAt(i);
            Name name = null;

            System.out.println(wb.getSheetName(i));
            for (Row row : sheet) {

                name = sheet.getWorkbook().createName();

                // System.out.println("rownum: " + row.getRowNum());

                for (Cell cell : row) {
                    // System.out.println(cell);

                    handleCell(cell.getCellType(), cell);
                }

            }
        }

    } catch (Exception e) {

        e.printStackTrace();
    }

}

0 个答案:

没有答案