Package org.apache.poi.hssf.record

Examples of org.apache.poi.hssf.record.CellValueRecordInterface


    InternalSheet sheet = InternalSheet.createSheet();

    RowRecord rr = new RowRecord(5);
    sheet.addRow(rr);

    CellValueRecordInterface cvr = new BlankRecord();
    cvr.setColumn((short)0);
    cvr.setRow(5);
    sheet.addValueRecord(5, cvr);


    int dbCellRecordPos = getDbCellRecordPos(sheet);
    if (dbCellRecordPos == 252) {
View Full Code Here


     
      // Now check we can turn all the numeric
      //  cells into strings without error
      for(int i=0; i<mockListen._records.size(); i++) {
        Record r = (Record)mockListen._records.get(i);
        CellValueRecordInterface cvr = null;
       
        if(r instanceof NumberRecord) {
          cvr = (CellValueRecordInterface)r;
        }
        if(r instanceof FormulaRecord) {
View Full Code Here

     */
    public int getRowCellBlockSize(int startRow, int endRow) {
      MyIterator itr = new MyIterator(startRow, endRow);
      int size = 0;
      while (itr.hasNext()) {
        CellValueRecordInterface cell = (CellValueRecordInterface)itr.next();
        int row = cell.getRow();
        if (row > endRow)
          break;
        if ((row >=startRow) && (row <= endRow))
          size += ((RecordBase)cell).getRecordSize();
      }
View Full Code Here

      MyIterator itr = new MyIterator(row, row);
        int      pos = offset;

        while (itr.hasNext())
        {
            CellValueRecordInterface cell = (CellValueRecordInterface)itr.next();
            if (cell.getRow() != row)
              break;
            pos += (( RecordBase ) cell).serialize(pos, data);
        }
        return pos - offset;
    }
View Full Code Here

    public void visitCellsForRow(int rowIndex, RecordVisitor rv) {

        CellValueRecordInterface[] cellRecs = records[rowIndex];
        if (cellRecs != null) {
            for (int i = 0; i < cellRecs.length; i++) {
                CellValueRecordInterface cvr = cellRecs[i];
                if (cvr == null) {
                    continue;
                }
                if (cvr instanceof RecordAggregate) {
                    RecordAggregate agg = (RecordAggregate) cvr;
View Full Code Here

            CellValueRecordInterface[] rowCells = records[i];
            if (rowCells == null) {
                continue;
            }
            for (int j = 0; j < rowCells.length; j++) {
                CellValueRecordInterface cell = rowCells[j];
                if (cell instanceof FormulaRecordAggregate) {
                  FormulaRecord fr = ((FormulaRecordAggregate)cell).getFormulaRecord();
                    Ptg[] ptgs = fr.getParsedExpression(); // needs clone() inside this getter?
                    if (shifter.adjustFormula(ptgs, currentExternSheetIndex)) {
                        fr.setParsedExpression(ptgs);
View Full Code Here

            CellValueRecordInterface[] rowCells = records[i];
            if (rowCells == null) {
                continue;
            }
            for (int j = 0; j < rowCells.length; j++) {
                CellValueRecordInterface cell = rowCells[j];
                if (cell != null) {
                    temp.add(cell);
                }
            }
        }
View Full Code Here

            throw new RuntimeException("Specified cell is not from this row");
        }
        cells[column]=null;
       
        if(alsoRemoveRecords) {
            CellValueRecordInterface cval = cell.getCellValueRecord();
            sheet.getSheet().removeValueRecord(getRowNum(), cval);
        }
       
        if (cell.getColumnIndex()+1 == row.getLastCol()) {
            row.setLastCol((short) (findLastCell(row.getLastCol())+1));
View Full Code Here

                new Long(timestart));
        HSSFRow lastrow = null;

        // Add every cell to its row
        for (int i = 0; i < cvals.length; i++) {
            CellValueRecordInterface cval = cvals[i];

            long cellstart = System.currentTimeMillis();
            HSSFRow hrow = lastrow;

            if (hrow == null || hrow.getRowNum() != cval.getRow()) {
                hrow = getRow( cval.getRow() );
                lastrow = hrow;
                if (hrow == null) {
                    // Some tools (like Perl module Spreadsheet::WriteExcel - bug 41187) skip the RowRecords
                    // Excel, OpenOffice.org and GoogleDocs are all OK with this, so POI should be too.
                    if (rowRecordsAlreadyPresent) {
                        // if at least one row record is present, all should be present.
                        throw new RuntimeException("Unexpected missing row when some rows already present");
                    }
                    // create the row record on the fly now.
                    RowRecord rowRec = new RowRecord(cval.getRow());
                    sheet.addRow(rowRec);
                    hrow = createRowFromRecord(rowRec);
                }
            }
            if (log.check( POILogger.DEBUG ))
View Full Code Here

            // Copy each cell from the source row to
            //  the destination row
            for(Iterator cells = row.cellIterator(); cells.hasNext(); ) {
                HSSFCell cell = (HSSFCell)cells.next();
                row.removeCell( cell );
                CellValueRecordInterface cellRecord = cell.getCellValueRecord();
                cellRecord.setRow( rowNum + n );
                row2Replace.createCellFromRecord( cellRecord );
                sheet.addValueRecord( rowNum + n, cellRecord );
            }
            // Now zap all the cells in the source row
            row.removeAllCells();
View Full Code Here

TOP

Related Classes of org.apache.poi.hssf.record.CellValueRecordInterface

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.