我需要做一個驗證,我需要知道單元格 c3 是否有字串“Numero”
但我收到一個錯誤:
> private int validaLinha(Row row) { String pedidoExcel = “Numero”;
>
> Cell teste = row.getCell(new CellReference("C3").getCol());
>
> try{
> if (teste == null || teste.getCellType() == Cell.CELL_TYPE_BLANK)
> return 0;
>
> if (teste == pedidoExcel)
> return 1;
>
> }catch (Exception e){
> return -1;
> }
}
在此處輸入圖片說明
uj5u.com熱心網友回復:
您需要獲取單元格和用戶的值等于。 https://poi.apache.org/apidocs/dev/org/apache/poi/ss/usermodel/Cell.html
if (pedidoExcel.equals(teste.getStringCellValue()))
return 1;
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/314165.html
標籤:爪哇 春天 apache-poi
上一篇:什么是物體類?
