Sheet.shiftRows详解

5,764 阅读1分钟

Sheet.shiftRows详解

 /**
     * Shifts rows between startRow and endRow n number of rows.
     * If you use a negative number, it will shift rows up.
     * Code ensures that rows don't wrap around
     *
     * <p>
     * Additionally shifts merged regions that are completely defined in these
     * rows (ie. merged 2 cells on a row to be shifted).
     * <p>
     * @param startRow the row to start shifting
                    (从下标为startRow的行开始移动)
     * @param endRow the row to end shifting
                    (到下标为endRow的行结束移动)
     * @param n the number of rows to shift
                    (有多少行需要移动)
     * @param copyRowHeight whether to copy the row height during the shift
     * @param resetOriginalRowHeight whether to set the original row's height to the default
     */
    void shiftRows(int startRow, int endRow, int n, boolean copyRowHeight, boolean resetOriginalRowHeight);
    
    例:sheet.shiftRows(insertRow,sheet.getLastRowNum(),1,true,false);
        sheet.createRow(insertRow);