Examples of HSSFRowHelper


Examples of org.zkoss.poi.hssf.usermodel.HSSFRowHelper

            if (!inbound) {
              if (row != null) {
                    if (resetOriginalRowHeight) {
                        row.setHeight((short)-1);
                    }
                    new HSSFRowHelper(row).removeAllCells();
              }
              continue;
            }
           
            HSSFRow row2Replace = getRow( rowNum + n );
            if (row != null) {
              if ( row2Replace == null )
                  row2Replace = createRow( rowNum + n );
 
              // Remove all the old cells from the row we'll
              //  be writing too, before we start overwriting
              //  any cells. This avoids issues with cells
              //  changing type, and records not being correctly
              //  overwritten
              new HSSFRowHelper(row2Replace).removeAllCells();
            } else {
              // If this row doesn't exist, shall also remove
              //  the empty destination row
              if (row2Replace != null) {
                removeRow(row2Replace);
              }
              continue; // Nothing to do for this row
            }

            // Fix up row heights if required
            if (copyRowHeight) {
                row2Replace.setHeight(row.getHeight());
            }
            if (resetOriginalRowHeight) {
                row.setHeight((short)0xff);
            }

            // Copy each cell from the source row to
            //  the destination row
            for(Iterator<Cell> cells = row.cellIterator(); cells.hasNext(); ) {
                HSSFCell cell = (HSSFCell)cells.next();
                row.removeCell( cell );
                CellValueRecordInterface cellRecord = new HSSFCellHelper(cell).getCellValueRecord();
                cellRecord.setRow( rowNum + n );
                new HSSFRowHelper(row2Replace).createCellFromRecord( cellRecord );
                _helper.getInternalSheet().addValueRecord( rowNum + n, cellRecord );
            }
            // Now zap all the cells in the source row
            new HSSFRowHelper(row).removeAllCells();

            // Move comments from the source row to the
            //  destination row. Note that comments can
            //  exist for cells which are null
            if(moveComments) {
View Full Code Here

Examples of org.zkoss.poi.hssf.usermodel.HSSFRowHelper

              if (row != null) {
                if (wholeRow) {
                      if (resetOriginalRowHeight) {
                          row.setHeight((short)-1); //default height
                      }
                      new HSSFRowHelper(row).removeAllCells();
                } else {
                  removeCells(row, lCol, rCol);
                }
              }
              continue;
            }
           
            HSSFRow row2Replace = getRow( rowNum + n );
            if (row != null) {
              if ( row2Replace == null )
                  row2Replace = createRow( rowNum + n );
 
              // Remove all the old cells from the row we'll
              //  be writing too, before we start overwriting
              //  any cells. This avoids issues with cells
              //  changing type, and records not being correctly
              //  overwritten
              if (wholeRow) {
                new HSSFRowHelper(row2Replace).removeAllCells();
              } else {
                removeCells(row2Replace, lCol, rCol);
              }
            } else {
              // If this row doesn't exist, shall also remove
              //  the empty destination row
              if (row2Replace != null) {
                if (wholeRow) {
                  removeRow(row2Replace);
                } else {
                    removeCells(row2Replace, lCol, rCol);
                }
              }
              continue; // Nothing to do for this row
            }

            // Fix up row heights if required
            if (wholeRow) {
              if (copyRowHeight) {
                  row2Replace.setHeight(row.getHeight());
              }
              if (resetOriginalRowHeight) {
                  row.setHeight((short)0xff);
              }
            }

            // Copy each cell from the source row to
            //  the destination row
            if (wholeRow) {
              for(Iterator<Cell> cells = row.cellIterator(); cells.hasNext(); ) {
                  HSSFCell cell = (HSSFCell)cells.next();
                  row.removeCell( cell );
                  CellValueRecordInterface cellRecord = new HSSFCellHelper(cell).getCellValueRecord();
                  cellRecord.setRow( rowNum + n );
                  new HSSFRowHelper(row2Replace).createCellFromRecord( cellRecord );
                  _helper.getInternalSheet().addValueRecord( rowNum + n, cellRecord );
              }
              // Now zap all the cells in the source row
              new HSSFRowHelper(row).removeAllCells();
            } else {
              final int startCol = Math.max(row.getFirstCellNum(), lCol);
              final int endCol = Math.min(row.getLastCellNum(), rCol);
              for(int col = startCol; col <= endCol; ++col) {
                  HSSFCell cell = (HSSFCell)row.getCell(col);
                  if (cell == null) {
                    continue;
                  }
                  row.removeCell( cell );
                  CellValueRecordInterface cellRecord = new HSSFCellHelper(cell).getCellValueRecord();
                  cellRecord.setRow( rowNum + n );
                  new HSSFRowHelper(row2Replace).createCellFromRecord( cellRecord );
                  _helper.getInternalSheet().addValueRecord( rowNum + n, cellRecord );
              }
              // Now zap the cells in the source row
              removeCells(row, lCol, rCol);
            }
View Full Code Here

Examples of org.zkoss.poi.hssf.usermodel.HSSFRowHelper

                cellRecord.setRow( rowNum + nRow );
                int colNum = cellRecord.getColumn() + nCol;
                if (colNum >= 0 && colNum <= maxcol) { //in bound
                  cellRecord.setColumn((short) colNum);
                }
                new HSSFRowHelper(row2Replace).createCellFromRecord( cellRecord );
                _helper.getInternalSheet().addValueRecord( rowNum + nRow, cellRecord );
            }
            // Now zap the cells in the source row
            removeCells(row, lCol, rCol);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.