POI注意點
獲取行數和列數問題
獲取行數
無論是HSSFSheet還是XSSFSheet
sheet.getLastRowNum()//結果下標從0開始
獲取列數
無論是HSSFCell還是XSSFCell
row.getLastCellNum();//從1開始
移動行
sheet.shiftRows(int startRow,int endRow, int n)
/*
在HSSFSheet中 n 可以爲 0,
sheet.getRow(移動之前的行)的返回值不爲null
*/
/*
在XSSFSheet中 n 不可以爲 0
sheet.getRow(移動之前的行)的返回值爲null
*/