Examples of CTPageBreak


Examples of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPageBreak

        }
        return null;
    }

    public int[] getRowBreaks() {
        CTPageBreak rowBreaks = getSheetTypeRowBreaks();
        int breaksCount = rowBreaks.getBrkArray().length;
        if (breaksCount == 0) {
            return null;
        }
        int[] breaks = new int[breaksCount];
        for (int i = 0 ; i < breaksCount ; i++) {
            CTBreak brk = rowBreaks.getBrkArray(i);
            breaks[i] = (int) brk.getId();
        }
        return breaks;
    }
View Full Code Here

Examples of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPageBreak

        // TODO Auto-generated method stub

    }

    public void setRowBreak(int row) {
        CTPageBreak pageBreak = getSheetTypeRowBreaks();
        if (! isRowBroken(row)) {
            CTBreak brk = pageBreak.addNewBrk();
            brk.setId(row);
        }
    }
View Full Code Here

Examples of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPageBreak

    /**
     * Sets a page break at the indicated row
     */
    public void setRowBreak(int row) {
        CTPageBreak pgBreak = worksheet.isSetRowBreaks() ? worksheet.getRowBreaks() : worksheet.addNewRowBreaks();
        if (! isRowBroken(row)) {
            CTBreak brk = pgBreak.addNewBrk();
            brk.setId(row);
        }
    }
View Full Code Here

Examples of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPageBreak

    /**
     * Removes the page break at the indicated row
     */
    public void removeRowBreak(int row) {
        CTPageBreak pgBreak = worksheet.isSetRowBreaks() ? worksheet.getRowBreaks() : worksheet.addNewRowBreaks();
        CTBreak[] brkArray = new CTBreak[pgBreak.getBrkList().size()];
        pgBreak.getBrkList().toArray(brkArray);
        for (int i = 0 ; i < brkArray.length ; i++) {
            if (brkArray[i].getId() == row) {
                pgBreak.removeBrk(i);
            }
        }
    }
View Full Code Here

Examples of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPageBreak

     * @param row the row to break, inclusive
     */
    @Override
    public void setRowBreak(int row) {
        if (!isRowBroken(row)) {
            CTPageBreak pgBreak = worksheet.isSetRowBreaks() ? worksheet.getRowBreaks() : worksheet.addNewRowBreaks();
            setBreak(row, pgBreak, SpreadsheetVersion.EXCEL2007.getLastColumnIndex());
        }
    }
View Full Code Here

Examples of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPageBreak

     * @param column the column to break, inclusive
     */
    @Override
    public void setColumnBreak(int column) {
        if (!isColumnBroken(column)) {
            CTPageBreak pgBreak = worksheet.isSetColBreaks() ? worksheet.getColBreaks() : worksheet.addNewColBreaks();
            setBreak(column, pgBreak, SpreadsheetVersion.EXCEL2007.getLastRowIndex());
        }
    }
View Full Code Here

Examples of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPageBreak

        }
        return null;
    }

    public int[] getRowBreaks() {
        CTPageBreak rowBreaks = getSheetTypeRowBreaks();
        int breaksCount = rowBreaks.getBrkArray().length;
        if (breaksCount == 0) {
            return null;
        }
        int[] breaks = new int[breaksCount];
        for (int i = 0 ; i < breaksCount ; i++) {
            CTBreak brk = rowBreaks.getBrkArray(i);
            breaks[i] = (int) brk.getId();
        }
        return breaks;
    }
View Full Code Here

Examples of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPageBreak

    public void setPrintGridlines(boolean newPrintGridlines) {
      getSheetTypePrintOptions().setGridLines(newPrintGridlines);
    }

    public void setRowBreak(int row) {
        CTPageBreak pageBreak = getSheetTypeRowBreaks();
        if (! isRowBroken(row)) {
            CTBreak brk = pageBreak.addNewBrk();
            brk.setId(row);
        }
    }
View Full Code Here

Examples of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPageBreak

     * and rows starting with rownum=4 in the second.
     *
     * @param row the row to break, inclusive
     */
    public void setRowBreak(int row) {
        CTPageBreak pgBreak = worksheet.isSetRowBreaks() ? worksheet.getRowBreaks() : worksheet.addNewRowBreaks();
        if (! isRowBroken(row)) {
            CTBreak brk = pgBreak.addNewBrk();
            brk.setId(row + 1); // this is id of the row element which is 1-based: <row r="1" ... >
            brk.setMan(true);
            brk.setMax(SpreadsheetVersion.EXCEL2007.getLastColumnIndex()); //end column of the break

            pgBreak.setCount(pgBreak.sizeOfBrkArray());
            pgBreak.setManualBreakCount(pgBreak.sizeOfBrkArray());
        }
    }
View Full Code Here

Examples of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPageBreak

        if (!worksheet.isSetColBreaks()) {
            // no breaks
            return;
        }

        CTPageBreak pgBreak = worksheet.getColBreaks();
        CTBreak[] brkArray = pgBreak.getBrkArray();
        for (int i = 0 ; i < brkArray.length ; i++) {
            if (brkArray[i].getId() == (column + 1)) {
                pgBreak.removeBrk(i);
            }
        }
    }
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.