Package org.apache.poi.hssf.util

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


                    refy1=(short)(y-4);
                    refy2=(short)(y-3);
                }
               
                c = r.getCell((short) y);
                CellReference cr= new CellReference(refx1,refy1);
                ref=cr.toString();
                cr=new CellReference(refx2,refy2);
                ref2=cr.toString();

                c = r.createCell((short) y);
                c.setCellFormula("" + ref + operator + ref2);
               
View Full Code Here


                    refy1=(short)(y-4);
                    refy2=(short)(y-3);
                }

                c = r.getCell((short) y);
                CellReference cr= new CellReference(refx1,refy1);
                ref=cr.toString();
                cr=new CellReference(refx2,refy2);
                ref2=cr.toString();
               
               
                assertTrue("loop Formula is as expected "+ref+operator+ref2+"!="+c.getCellFormula(),(
                (""+ref+operator+ref2).equals(c.getCellFormula())
                                                         )
View Full Code Here

                    refy1=(short)(y-4);
                    refy2=(short)(y-3);
                }

                c = r.getCell(y);
                CellReference cr= new CellReference(refx1,refy1, false, false);
                ref=cr.formatAsString();
                cr=new CellReference(refx2,refy2, false, false);
                ref2=cr.formatAsString();

                c = r.createCell(y);
                c.setCellFormula("" + ref + operator + ref2);

View Full Code Here

                    refy1=y-4;
                    refy2=y-3;
                }

                c = r.getCell(y);
                CellReference cr= new CellReference(refx1, refy1, false, false);
                String ref=cr.formatAsString();
                ref=cr.formatAsString();
                cr=new CellReference(refx2,refy2, false, false);
                String ref2=cr.formatAsString();


                assertTrue("loop Formula is as expected "+ref+operator+ref2+"!="+c.getCellFormula(),(
                (""+ref+operator+ref2).equals(c.getCellFormula())
                                                         )
View Full Code Here

      }
      FormulaRecordAggregate record = (FormulaRecordAggregate) cell.getCellValueRecord();
      FormulaRecord r = record.getFormulaRecord();
      Ptg[] ptgs = r.getParsedExpression();
     
      String cellRef = new CellReference(row.getRowNum(), cell.getColumnIndex(), false, false).formatAsString();
      if(false && cellRef.equals("BP24")) { // TODO - replace System.out.println()s with asserts
        System.out.print(cellRef);
        System.out.println(" - has " + ptgs.length + " ptgs:");
        for(int i=0; i<ptgs.length; i++) {
          String c = ptgs[i].getClass().toString();
View Full Code Here

    assertEquals(ar.getFirstCell().getCol(), ae.getFirstColumn());
    assertEquals(ar.getLastCell().getCol(), ae.getLastColumn());
  }

  private static Eval createRefEval(String refStr) {
    CellReference cr = new CellReference(refStr);
    return new MockRefEval(cr.getRow(), cr.getCol());

  }
View Full Code Here

     */
    public void setPrintArea(int sheetIndex, int startColumn, int endColumn,
                              int startRow, int endRow) {

        //using absolute references because they don't get copied and pasted anyway
        CellReference cell = new CellReference(startRow, startColumn, true, true);
        String reference = cell.formatAsString();

        cell = new CellReference(endRow, endColumn, true, true);
        reference = reference+":"+cell.formatAsString();

        setPrintArea(sheetIndex, reference);
    }
View Full Code Here

    assertEquals(ar.getFirstCell().getCol(), ae.getFirstColumn());
    assertEquals(ar.getLastCell().getCol(), ae.getLastColumn());
  }

  private static ValueEval createRefEval(String refStr) {
    CellReference cr = new CellReference(refStr);
    return new MockRefEval(cr.getRow(), cr.getCol());

  }
View Full Code Here

        /**
         * contains coordinates of comments we iterate over
         */
        Set<String> coordinates = new HashSet<String>(tailRecords.size());
        for(NoteRecord rec : tailRecords.values()){
            String noteRef = new CellReference(rec.getRow(),
                    rec.getColumn()).formatAsString(); // A1-style notation
            if(coordinates.contains(noteRef )){
                throw new IllegalStateException("found multiple cell comments for cell " + noteRef );
            } else {
                coordinates.add(noteRef);
View Full Code Here

     */
    public void setPrintArea(int sheetIndex, int startColumn, int endColumn,
                              int startRow, int endRow) {

        //using absolute references because they don't get copied and pasted anyway
        CellReference cell = new CellReference(startRow, startColumn, true, true);
        String reference = cell.formatAsString();

        cell = new CellReference(endRow, endColumn, true, true);
        reference = reference+":"+cell.formatAsString();

        setPrintArea(sheetIndex, reference);
    }
View Full Code Here

TOP

Related Classes of org.apache.poi.hssf.util.CellReference

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.