Examples of AreaReference


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

     * @param sourceSheet Sheet where the source will be collected from
     */
    @Beta
    protected void createSourceReferences(AreaReference source, CellReference position, Sheet sourceSheet){
        //Get cell one to the right and one down from position, add both to AreaReference and set pivot table location.
        AreaReference destination = new AreaReference(position, new CellReference(position.getRow()+1, position.getCol()+1));

        CTLocation location;
        if(pivotTableDefinition.getLocation() == null) {
            location = pivotTableDefinition.addNewLocation();
            location.setFirstDataCol(1);
            location.setFirstDataRow(1);
            location.setFirstHeaderRow(1);
        } else {
            location = pivotTableDefinition.getLocation();
        }
        location.setRef(destination.formatAsString());
        pivotTableDefinition.setLocation(location);

        //Set source for the pivot table
        CTPivotCacheDefinition cacheDef = getPivotCacheDefinition().getCTPivotCacheDefinition();
        CTCacheSource cacheSource = cacheDef.addNewCacheSource();
View Full Code Here

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

        if (pivotTableDefinition.getPivotFields() != null) {
            pivotFields = pivotTableDefinition.getPivotFields();
        } else {
            pivotFields = pivotTableDefinition.addNewPivotFields();
        }
        AreaReference sourceArea = getPivotArea();
        int firstColumn = sourceArea.getFirstCell().getCol();
        int lastColumn = sourceArea.getLastCell().getCol();
        CTPivotField pivotField;
        for(int i = 0; i<=lastColumn-firstColumn; i++) {
            pivotField = pivotFields.addNewPivotField();
            pivotField.setDataField(false);
            pivotField.setShowAll(false);
View Full Code Here

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

       assertEquals("Abc,1", sheet.getSheetName());
      
       Name name = wb.getName("Intekon.ProdCodes");
       assertEquals("'Abc,1'!$A$1:$A$2", name.getRefersToFormula());
      
       AreaReference ref = new AreaReference(name.getRefersToFormula());
       assertEquals(0, ref.getFirstCell().getRow());
       assertEquals(0, ref.getFirstCell().getCol());
       assertEquals(1, ref.getLastCell().getRow());
       assertEquals(0, ref.getLastCell().getCol());
    }
View Full Code Here

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

       assertEquals("Abc,1", sheet.getSheetName());
      
       Name name = wb.getName("Intekon.ProdCodes");
       assertEquals("'Abc,1'!$A$1:$A$2", name.getRefersToFormula());
      
       AreaReference ref = new AreaReference(name.getRefersToFormula());
       assertEquals(0, ref.getFirstCell().getRow());
       assertEquals(0, ref.getFirstCell().getCol());
       assertEquals(1, ref.getLastCell().getRow());
       assertEquals(0, ref.getLastCell().getCol());
    }
View Full Code Here

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

       assertEquals("Abc,1", sheet.getSheetName());
      
       Name name = wb.getName("Intekon.ProdCodes");
       assertEquals("'Abc,1'!$A$1:$A$2", name.getRefersToFormula());
      
       AreaReference ref = new AreaReference(name.getRefersToFormula());
       assertEquals(0, ref.getFirstCell().getRow());
       assertEquals(0, ref.getFirstCell().getCol());
       assertEquals(1, ref.getLastCell().getRow());
       assertEquals(0, ref.getLastCell().getCol());
    }
View Full Code Here

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

  private int field_1_index_extern_sheet;


  public Area3DPtg(String arearef, int externIdx) {
    super(new AreaReference(arearef));
    setExternSheetIndex(externIdx);
  }
View Full Code Here

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

  }
  public AreaPtg(LittleEndianInput in)  {
    super(in);
  }
  public AreaPtg(String arearef) {
    super(new AreaReference(arearef));
  }
View Full Code Here

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

       assertEquals("Abc,1", sheet.getSheetName());
      
       Name name = wb.getName("Intekon.ProdCodes");
       assertEquals("'Abc,1'!$A$1:$A$2", name.getRefersToFormula());
      
       AreaReference ref = new AreaReference(name.getRefersToFormula());
       assertEquals(0, ref.getFirstCell().getRow());
       assertEquals(0, ref.getFirstCell().getCol());
       assertEquals(1, ref.getLastCell().getRow());
       assertEquals(0, ref.getLastCell().getCol());
    }
View Full Code Here

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

       assertEquals("Abc,1", sheet.getSheetName());
      
       Name name = wb.getName("Intekon.ProdCodes");
       assertEquals("'Abc,1'!$A$1:$A$2", name.getRefersToFormula());
      
       AreaReference ref = new AreaReference(name.getRefersToFormula());
       assertEquals(0, ref.getFirstCell().getRow());
       assertEquals(0, ref.getFirstCell().getCol());
       assertEquals(1, ref.getLastCell().getRow());
       assertEquals(0, ref.getLastCell().getCol());
    }
View Full Code Here

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

        XSSFWorkbook wb = setupSheet();
        XSSFSheet sheet = wb.getSheetAt(0);

        assertNotNull(wb);
        assertNotNull(sheet);
        XSSFPivotTable pivotTable = sheet.createPivotTable(new AreaReference("A1:B2"), new CellReference("H5"));
        assertNotNull(pivotTable);
        assertTrue(wb.getPivotTables().size() > 0);
        XSSFPivotTable pivotTable2 = sheet.createPivotTable(new AreaReference("A1:B2"), new CellReference("L5"), sheet);
        assertNotNull(pivotTable2);
        assertTrue(wb.getPivotTables().size() > 1);
    }
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.