Package org.zkoss.poi.hssf.usermodel

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


  }
  private static void setHSSFCellPtgs(HSSFCell cell, Ptg[] ptgs) {
      //tricky! must be after the dummyCell construction or the under aggregate record will not
      //be consistent in sheet and cell
        cell.setCellType(Cell.CELL_TYPE_FORMULA);
      FormulaRecordAggregate agg = (FormulaRecordAggregate) new HSSFCellHelper((HSSFCell)cell).getCellValueRecord();
      FormulaRecord frec = agg.getFormulaRecord();
      frec.setOptions((short) 2);
      frec.setValue(0);

      //only set to default if there is no extended format index already set
View Full Code Here


    }
    throw new UiException("Unknown cell class:"+cell);
  }
 
  private static Ptg[] getHSSFPtgs(HSSFCell cell) {
    CellValueRecordInterface vr = new HSSFCellHelper(cell).getCellValueRecord();
    if (!(vr instanceof FormulaRecordAggregate)) {
      throw new IllegalArgumentException("Not a formula cell");
    }
    FormulaRecordAggregate fra = (FormulaRecordAggregate) vr;
    return fra.getFormulaTokens();
View Full Code Here

      }
    }
  }
 
  private static void shiftHSSFFormulas(PtgShifter shifter, int sheetIndex, Cell cell) {
    CellValueRecordInterface vr = new HSSFCellHelper((HSSFCell)cell).getCellValueRecord();
    if (!(vr instanceof FormulaRecordAggregate)) {
      throw new IllegalArgumentException("Not a formula cell");
    }
    FormulaRecordAggregate fra = (FormulaRecordAggregate) vr;
    Ptg[] ptgs = fra.getFormulaTokens();//getFormulaRecord().getParsedExpression();
View Full Code Here

            // 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
View Full Code Here

            //  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
View Full Code Here

                HSSFCell cell = (HSSFCell)row.getCell(col);
                if (cell == null) {
                  continue;
                }
                row.removeCell( cell );
                CellValueRecordInterface cellRecord = new HSSFCellHelper(cell).getCellValueRecord();
                cellRecord.setRow( rowNum + nRow );
                int colNum = cellRecord.getColumn() + nCol;
                if (colNum >= 0 && colNum <= maxcol) { //in bound
                  cellRecord.setColumn((short) colNum);
                }
View Full Code Here

TOP

Related Classes of org.zkoss.poi.hssf.usermodel.HSSFCellHelper

Copyright © 2018 www.massapicom. 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.