How to get row count in an Excel file using POI library?

前端 未结 7 2144
执念已碎
执念已碎 2020-12-08 09:37

Guys I\'m currently using the POI 3.9 library to work with excel files. I know of the getLastRowNum() function, which returns a number of rows in an Excel file.

7条回答
  •  执笔经年
    2020-12-08 10:02

    getLastRowNum() return index of last row.

    So if you wants to know total number of row = getLastRowNum() +1.

    I hope this will work.

    int rowTotal = sheet.getLastRowNum() +1;
    

提交回复
热议问题