ShiftRows方法簡介

ShiftRows 是HSSFSheet工做薄的方法.net

ShiftRows(int startRow,int endRow,int n)
參數介紹:
startRow:開始行
endRow:末尾行
n:移動n行數startRow到endRow數據域,至關於把行startRow(假如是第2行)到行endRow(假如是第4行)的表格剪切掉,而後按照n(假如是2)的倍數複製到endRow+1行,也就是插入6行數據到第五行(正數:向下移,負數:向上移)blog

使用:
一、工做薄中出現空行,想要刪除該空行,假設空行的行號:rowIndex,
工做薄最後一行行號:LastRowIndex。
將rowIndex 到 LastRowIndex的數據移動向上移動一行,即將rowIndex行覆蓋掉。
操做:ShiftRows(rowIndex-1,LastRowIndex,1)

get

 

本文轉自:https://blog.csdn.net/MAmQm/article/details/83014099it

相關文章
相關標籤/搜索