Examples of AreaReference


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

    // Get all the named ranges in our spreadsheet
    for (int namedRangeIdx = 0; namedRangeIdx < numberOfNames; namedRangeIdx++) {
      HSSFName aNamedRage = wb.getNameAt(namedRangeIdx);

      // retrieve the cell at the named range and test its contents
      AreaReference aref = new AreaReference(aNamedRage.getReference());
      CellReference[] crefs = aref.getAllReferencedCells();

      // A Range that we will put the new cells into
      Range redRange = new Range(aNamedRage.getNameName());

      for (int thisCellinRange = 0; thisCellinRange < crefs.length; thisCellinRange++) {
View Full Code Here

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

    for (int namedCellIdx = 0; namedCellIdx < numberOfNames; namedCellIdx++) {
      HSSFName aNamedCell = wb.getNameAt(namedCellIdx);

      // retrieve the cell at the named range and test its contents
      AreaReference aref = new AreaReference(aNamedCell.getReference());
      CellReference[] crefs = aref.getAllReferencedCells();

      for (int thisCellinRange = 0; thisCellinRange < crefs.length; thisCellinRange++) {
        HSSFSheet sheet = wb.getSheet(crefs[thisCellinRange]
            .getSheetName());
View Full Code Here

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

    private final static BitField   rowRelative = BitFieldFactory.getInstance(0x8000);
    private final static BitField   colRelative = BitFieldFactory.getInstance(0x4000);
    private final static BitField   columnMask      = BitFieldFactory.getInstance(0x3FFF);

    protected AreaPtgBase(String arearef) {
        AreaReference ar = new AreaReference(arearef);
        CellReference firstCell = ar.getFirstCell();
        CellReference lastCell = ar.getLastCell();
        setFirstRow(firstCell.getRow());
        setFirstColumn(firstCell.getCol());
        setLastRow(lastCell.getRow());
        setLastColumn(lastCell.getCol());
        setFirstColRelative(!firstCell.isColAbsolute());
View Full Code Here

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

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

    // retrieve the cell at the named range and test its contents
    AreaReference aref = new AreaReference(aNamedCell.getReference());
    assertTrue("Should be exactly 1 cell in the named cell :'" +cellName+"'", aref.isSingleCell());

    CellReference cref = aref.getFirstCell();
    assertNotNull(cref);
    HSSFSheet s = wb.getSheet(cref.getSheetName());
    assertNotNull(s);
    HSSFRow r = sheet.getRow(cref.getRow());
    HSSFCell c = r.getCell(cref.getCol());
View Full Code Here

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

    assertEquals(2, wb.getNumberOfNames());

    HSSFName name1 = wb.getNameAt(0);
    assertEquals("a", name1.getNameName());
    assertEquals("Sheet1!$A$1", name1.getReference());
    AreaReference ref1 = new AreaReference(name1.getReference());
    assertTrue("Successfully constructed first reference", true);

    HSSFName name2 = wb.getNameAt(1);
    assertEquals("b", name2.getNameName());
    assertEquals("#REF!", name2.getReference());
    assertTrue(name2.isDeleted());
    try {
      AreaReference ref2 = new AreaReference(name2.getReference());
      fail("attempt to supply an invalid reference to AreaReference constructor results in exception");
    } catch (StringIndexOutOfBoundsException e) { // TODO - use a different exception for this condition
      // expected during successful test
    }
   }
View Full Code Here

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

    return result;
  }*/

  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() );
View Full Code Here

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

    private AreaPtg() {
      //Required for clone methods
    }
  
    public AreaPtg(String arearef) {
        AreaReference ar = new AreaReference(arearef);
        setFirstRow((short)ar.getCells()[0].getRow());
        setFirstColumn((short)ar.getCells()[0].getCol());
        setLastRow((short)ar.getCells()[1].getRow());
        setLastColumn((short)ar.getCells()[1].getCol());
        setFirstColRelative(!ar.getCells()[0].isColAbsolute());
        setLastColRelative(!ar.getCells()[1].isColAbsolute());
        setFirstRowRelative(!ar.getCells()[0].isRowAbsolute());
        setLastRowRelative(!ar.getCells()[1].isRowAbsolute());
       
    }
View Full Code Here

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

    ValueEval[] args = {
      createRefEval(refA),
      createRefEval(refB),
    };
    AreaReference ar = new AreaReference(expectedAreaRef);
    ValueEval result = EvalInstances.Range.evaluate(args, 0, (short)0);
    assertTrue(result instanceof AreaEval);
    AreaEval ae = (AreaEval) result;
    assertEquals(ar.getFirstCell().getRow(), ae.getFirstRow());
    assertEquals(ar.getLastCell().getRow(), ae.getLastRow());
    assertEquals(ar.getFirstCell().getCol(), ae.getFirstColumn());
    assertEquals(ar.getLastCell().getCol(), ae.getLastColumn());
  }
View Full Code Here

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

    return result;
  }*/

  public void setArea( String ref )
  {
    AreaReference ar = new AreaReference( ref );

    setFirstRow( (short) ar.getCells()[0].getRow() );
    setFirstColumn( (short) ar.getCells()[0].getCol() );
    setLastRow( (short) ar.getCells()[1].getRow() );
    setLastColumn( (short) ar.getCells()[1].getCol() );
    setFirstColRelative( !ar.getCells()[0].isColAbsolute() );
    setLastColRelative( !ar.getCells()[1].isColAbsolute() );
    setFirstRowRelative( !ar.getCells()[0].isRowAbsolute() );
    setLastRowRelative( !ar.getCells()[1].isRowAbsolute() );

  }
View Full Code Here

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

    private AreaPtg() {
      //Required for clone methods
    }
  
    public AreaPtg(String arearef) {
        AreaReference ar = new AreaReference(arearef);
        setFirstRow((short)ar.getCells()[0].getRow());
        setFirstColumn((short)ar.getCells()[0].getCol());
        setLastRow((short)ar.getCells()[1].getRow());
        setLastColumn((short)ar.getCells()[1].getCol());
        setFirstColRelative(!ar.getCells()[0].isColAbsolute());
        setLastColRelative(!ar.getCells()[1].isColAbsolute());
        setFirstRowRelative(!ar.getCells()[0].isRowAbsolute());
        setLastRowRelative(!ar.getCells()[1].isRowAbsolute());
       
    }
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.