sheet.getPhysicalNumberOfRows();
獲取有記錄的行數 (NULL列數略過不計)


sheet.getLastRowNum();
獲取最後行數,回傳值為最後行數-1 (只有一行的話回傳0)
the number of the last row contained in this sheet, zero based.
Owing to idiosyncrasies in the excel file format, if the result of calling this method is zero, you can't tell if that means there are zero rows on the sheet, or one at position zero. For that case, additionally call getPhysicalNumberOfRows() to tell if there is a row at position zero or not.


row.getPhysicalNumberOfCells();
獲取有記錄的單元格數(NULL格數略過不計),例如欄位第0.4.5有資料(1.2.3為NULL) 回傳3
int representing the number of defined cells in the row.
if only columns 0,4,5 have values then there would be 3.


row.getLastCellNum();
獲取最後單元格數,回傳值為最後格數(不需減1) (只有一格的話回傳1),無資料回傳-1
short representing the last logical cell in the row PLUS ONE, or -1 if the row does not contain any cells.
 

    咪卡恰比 發表在 痞客邦 留言(0) 人氣()