Examples of AreaReference


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

    private int externalWorkbookNumber = -1;
    private String firstSheetName;
    private String lastSheetName;

  public Area3DPxg(int externalWorkbookNumber, SheetIdentifier sheetName, String arearef) {
    this(externalWorkbookNumber, sheetName, new AreaReference(arearef));
  }
View Full Code Here

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

            this.lastSheetName = null;
        }
    }

    public Area3DPxg(SheetIdentifier sheetName, String arearef) {
        this(sheetName, new AreaReference(arearef));
    }
View Full Code Here

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

        assertEquals(2, wb.getNumberOfNames());

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

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

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

     * @param sheet The sheet where the data i collected from
     */
    @Beta
    protected void createCacheFields(Sheet sheet) {
        //Get values for start row, start and end column
        AreaReference ar = new AreaReference(ctPivotCacheDefinition.getCacheSource().getWorksheetSource().getRef());
        CellReference firstCell = ar.getFirstCell();
        CellReference lastCell = ar.getLastCell();
        int columnStart = firstCell.getCol();
        int columnEnd = lastCell.getCol();
        Row row = sheet.getRow(firstCell.getRow());
        CTCacheFields cFields;
        if(ctPivotCacheDefinition.getCacheFields() != null) {
View Full Code Here

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

        style.setShowColHeaders(true);
        style.setShowRowHeaders(true);
    }

    protected AreaReference getPivotArea() {
        AreaReference pivotArea = new AreaReference(getPivotCacheDefinition().
                getCTPivotCacheDefinition().getCacheSource().getWorksheetSource().getRef());
        return pivotArea;
    }
View Full Code Here

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

     * Add a row label using data from the given column.
     * @param columnIndex the index of the column to be used as row label.
     */
    @Beta
    public void addRowLabel(int columnIndex) {
        AreaReference pivotArea = getPivotArea();
        int lastRowIndex = pivotArea.getLastCell().getRow() - pivotArea.getFirstCell().getRow();
        int lastColIndex = pivotArea.getLastCell().getCol() - pivotArea.getFirstCell().getCol();

        if(columnIndex > lastColIndex) {
            throw new IndexOutOfBoundsException();
        }
        CTPivotFields pivotFields = pivotTableDefinition.getPivotFields();
View Full Code Here

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

     * The following functions exists:
     * Sum, Count, Average, Max, Min, Product, Count numbers, StdDev, StdDevp, Var, Varp
     */
    @Beta
    public void addColumnLabel(DataConsolidateFunction function, int columnIndex) {
        AreaReference pivotArea = getPivotArea();
        int lastColIndex = pivotArea.getLastCell().getCol() - pivotArea.getFirstCell().getCol();

        if(columnIndex > lastColIndex && columnIndex < 0) {
            throw new IndexOutOfBoundsException();
        }

View Full Code Here

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

     * The following functions exists:
     * Sum, Count, Average, Max, Min, Product, Count numbers, StdDev, StdDevp, Var, Varp
     */
    @Beta
    private void addDataField(DataConsolidateFunction function, int columnIndex) {
        AreaReference pivotArea = getPivotArea();
        int lastColIndex = pivotArea.getLastCell().getCol() - pivotArea.getFirstCell().getCol();

        if(columnIndex > lastColIndex && columnIndex < 0) {
            throw new IndexOutOfBoundsException();
        }
        CTDataFields dataFields;
        if(pivotTableDefinition.getDataFields() != null) {
            dataFields = pivotTableDefinition.getDataFields();
        } else {
            dataFields = pivotTableDefinition.addNewDataFields();
        }
        CTDataField dataField = dataFields.addNewDataField();
        dataField.setSubtotal(STDataConsolidateFunction.Enum.forInt(function.getValue()));
        Cell cell = getDataSheet().getRow(pivotArea.getFirstCell().getRow()).getCell(columnIndex);
        cell.setCellType(Cell.CELL_TYPE_STRING);
        dataField.setName(function.getName());
        dataField.setFld(columnIndex);
        dataFields.setCount(dataFields.getDataFieldList().size());
    }
View Full Code Here

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

     * @param columnIndex the index of the column containing the data
     * @param isDataField true if the data should be displayed in the pivot table.
     */
    @Beta
    public void addDataColumn(int columnIndex, boolean isDataField) {
        AreaReference pivotArea = getPivotArea();
        int lastColIndex = pivotArea.getLastCell().getCol() - pivotArea.getFirstCell().getCol();
        if(columnIndex > lastColIndex && columnIndex < 0) {
            throw new IndexOutOfBoundsException();
        }
        CTPivotFields pivotFields = pivotTableDefinition.getPivotFields();
        List<CTPivotField> pivotFieldList = pivotFields.getPivotFieldList();
View Full Code Here

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

     * Add filter for the column with the corresponding index and cell value
     * @param columnIndex index of column to filter on
     */
    @Beta
    public void addReportFilter(int columnIndex) {
        AreaReference pivotArea = getPivotArea();
        int lastColIndex = pivotArea.getLastCell().getCol() - pivotArea.getFirstCell().getCol();
        int lastRowIndex = pivotArea.getLastCell().getRow() - pivotArea.getFirstCell().getRow();

        if(columnIndex > lastColIndex && columnIndex < 0) {
            throw new IndexOutOfBoundsException();
        }
        CTPivotFields pivotFields = pivotTableDefinition.getPivotFields();
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.