如何在Java中重新调整Excel数据的值

时间:2019-05-31 16:24:49

标签: java

我无法返回值,有人可以帮我吗 如何返回以下值?

String invoiceNumber ;
Iterator<Sheet> sheetIt = wb.sheetIterator();
while (sheetIt.hasNext()) {
    Sheet sheet= sheetIt.next();
    Iterator<Row> rowIterator = sheet.rowIterator();            
    while (rowIterator.hasNext()) {
        Row row = rowIterator.next();
        Iterator<Cell> cellIt = row.cellIterator();
        while (cellIt.hasNext()) {
            Cell cell = cellIt.next();
            if(cell.getStringCellValue().equals("Invoice Number")) {
                invoiceNumber=  row.getCell(cell.getColumnIndex()+1).getStringCellValue();

            }                   
        }               
    }
}

0 个答案:

没有答案