Examples of CellReference


Examples of org.apache.poi.hssf.util.CellReference

    int namedCellIdx = wb.getNameIndex(cname);
    HSSFName aNamedCell = wb.getNameAt(namedCellIdx);
    assertNotNull(aNamedCell);

    // retrieve the cell at the named range and test its contents
    CellReference cref = new CellReference(aNamedCell.getReference());
    assertNotNull(cref);
    HSSFSheet s = wb.getSheet(cref.getSheetName());
    HSSFRow r = sheet.getRow(cref.getRow());
    HSSFCell c = r.getCell(cref.getCol());
    String contents = c.getRichStringCellValue().getString();
    assertEquals("Contents of cell retrieved by its named reference", contents, cvalue);
  }
View Full Code Here

Examples of org.apache.poi.hssf.util.CellReference

    /**
     * Takes in a String representation of a cell reference and fills out the
     * numeric fields.
     */
    protected RefPtgBase(String cellref) {
        CellReference c= new CellReference(cellref);
        setRow(c.getRow());
        setColumn(c.getCol());
        setColRelative(!c.isColAbsolute());
        setRowRelative(!c.isRowAbsolute());
    }
View Full Code Here

Examples of org.apache.poi.hssf.util.CellReference

        field_1_row = in.readUShort();
        field_2_col = in.readUShort();
    }

    public final String toString() {
        CellReference cr = new CellReference(getRow(), getColumn(), !isRowRelative(),!isColRelative());
        StringBuffer sb = new StringBuffer();
        sb.append(getClass().getName());
        sb.append(" [");
        sb.append(cr.formatAsString());
        sb.append("]");
        return sb.toString();
    }
View Full Code Here

Examples of org.apache.poi.hssf.util.CellReference

        return SIZE;
    }

    public final String toFormulaString(HSSFWorkbook book) {
        //TODO -- should we store a cellreference instance in this ptg?? but .. memory is an issue, i believe!
        return (new CellReference(getRowAsInt(),getColumn(),!isRowRelative(),!isColRelative())).formatAsString();
    }
View Full Code Here

Examples of org.apache.poi.hssf.util.CellReference

  public void setArea( String ref )
  {
    AreaReference ar = new AreaReference( ref );
   
    CellReference frstCell = ar.getFirstCell();
    CellReference lastCell = ar.getLastCell();

    setFirstRow(  (short) frstCell.getRow() );
    setFirstColumn(     frstCell.getCol() );
    setLastRow(   (short) lastCell.getRow() );
    setLastColumn(      lastCell.getCol() );
    setFirstColRelative( !frstCell.isColAbsolute() );
    setLastColRelative!lastCell.isColAbsolute() );
    setFirstRowRelative( !frstCell.isRowAbsolute() );
    setLastRowRelative!lastCell.isRowAbsolute() );
  }
View Full Code Here

Examples of org.apache.poi.hssf.util.CellReference

        if (workbook == null) {
          FileInputStream fin = new FileInputStream( FILENAME );
          workbook = new HSSFWorkbook( fin );
          fin.close();       
        }
        this.beginCell = new CellReference(beginCell);
    }
View Full Code Here

Examples of org.apache.poi.hssf.util.CellReference

    /**
     * Takes in a String represnetation of a cell reference and fills out the
     * numeric fields.
     */
    public ReferencePtg(String cellref) {
        CellReference c= new CellReference(cellref);
        setRow((short) c.getRow());
        setColumn((short) c.getCol());
        setColRelative(!c.isColAbsolute());
        setRowRelative(!c.isRowAbsolute());
    }
View Full Code Here

Examples of org.apache.poi.ss.util.CellReference

    if(anchorName != null)
    {
      HSSFName aName = workbook.createName();
//      aName.setNameName(JRStringUtil.getJavaIdentifier(anchorName));
      aName.setSheetIndex(workbook.getSheetIndex(sheet));
      CellReference cRef = new CellReference(rowIndex, colIndex);
      aName.setRefersToFormula(cRef.formatAsString());
      anchorNames.put(anchorName, aName);
    }

    setHyperlinkCell(textElement);
  }
View Full Code Here

Examples of org.apache.poi.ss.util.CellReference

   */
  private NotImplementedException addExceptionInfo(NotImplementedException inner, int sheetIndex, int rowIndex, int columnIndex) {

    try {
      String sheetName = _workbook.getSheetName(sheetIndex);
      CellReference cr = new CellReference(sheetName, rowIndex, columnIndex, false, false);
      String msg =  "Error evaluating cell " + cr.formatAsString();
      return new NotImplementedException(msg, inner);
    } catch (Exception e) {
      // avoid bombing out during exception handling
      e.printStackTrace();
      return inner; // preserve original exception
View Full Code Here

Examples of org.apache.poi.ss.util.CellReference

      }
      return cce.getValue();
    }
    if (isDebugLogEnabled()) {
      String sheetName = getSheetName(sheetIndex);
      CellReference cr = new CellReference(rowIndex, columnIndex);
      logDebug("Evaluated " + sheetName + "!" + cr.formatAsString() + " to " + result.toString());
    }
    // Usually (result === cce.getValue())
    // But sometimes: (result==ErrorEval.CIRCULAR_REF_ERROR, cce.getValue()==null)
    // When circular references are detected, the cache entry is only updated for
    // the top evaluation frame
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.