Package org.openxmlformats.schemas.spreadsheetml.x2006.main

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


     */
    public void setLeftBorderColor(XSSFColor color) {
        CTBorder ct = getCTBorder();
        if(color == null && !ct.isSetLeft()) return;

        CTBorderPr pr = ct.isSetLeft() ? ct.getLeft() : ct.addNewLeft();
        if(color != nullpr.setColor(color.getCTColor());
        else pr.unsetColor();

        int idx = _stylesSource.putBorder(new XSSFCellBorder(ct, _theme));

        _cellXf.setBorderId(idx);
        _cellXf.setApplyBorder(true);
View Full Code Here


     */
    public void setRightBorderColor(XSSFColor color) {
        CTBorder ct = getCTBorder();
        if(color == null && !ct.isSetRight()) return;

        CTBorderPr pr = ct.isSetRight() ? ct.getRight() : ct.addNewRight();
        if(color != nullpr.setColor(color.getCTColor());
        else pr.unsetColor();

        int idx = _stylesSource.putBorder(new XSSFCellBorder(ct, _theme));

        _cellXf.setBorderId(idx);
        _cellXf.setApplyBorder(true);
View Full Code Here

     */
    public void setTopBorderColor(XSSFColor color) {
        CTBorder ct = getCTBorder();
        if(color == null && !ct.isSetTop()) return;

        CTBorderPr pr = ct.isSetTop() ? ct.getTop() : ct.addNewTop();
        if(color != nullpr.setColor(color.getCTColor());
        else pr.unsetColor();

        int idx = _stylesSource.putBorder(new XSSFCellBorder(ct, _theme));

        _cellXf.setBorderId(idx);
        _cellXf.setApplyBorder(true);
View Full Code Here

                for (CTFill fill : ctfills.getFillArray()) {
                    fills.add(new XSSFCellFill(fill));
                }
            }

            CTBorders ctborders = styleSheet.getBorders();
            if(ctborders != null) {
                for (CTBorder border : ctborders.getBorderArray()) {
                    borders.add(new XSSFCellBorder(border));
                }
            }

            CTCellXfs cellXfs = styleSheet.getCellXfs();
View Full Code Here

    for(XSSFCellFill f : fills) ctf[idx++] = f.getCTFill();
    ctFills.setFillArray(ctf);
    styleSheet.setFills(ctFills);

    // Borders
    CTBorders ctBorders = CTBorders.Factory.newInstance();
    ctBorders.setCount(borders.size());
    CTBorder[] ctb = new CTBorder[borders.size()];
    idx = 0;
    for(XSSFCellBorder b : borders) ctb[idx++] = b.getCTBorder();
    ctBorders.setBorderArray(ctb);
    styleSheet.setBorders(ctBorders);

    // Xfs
    if(xfs.size() > 0) {
      CTCellXfs ctXfs = CTCellXfs.Factory.newInstance();
View Full Code Here

     * @since 3.8
     */
    @Override
    public void setForceFormulaRecalculation(boolean value){
        CTWorkbook ctWorkbook = getCTWorkbook();
        CTCalcPr calcPr = ctWorkbook.isSetCalcPr() ? ctWorkbook.getCalcPr() : ctWorkbook.addNewCalcPr();
        // when set to 0, will tell Excel that it needs to recalculate all formulas
        // in the workbook the next time the file is opened.
        calcPr.setCalcId(0);

        if(value && calcPr.getCalcMode() == STCalcMode.MANUAL) {
            calcPr.setCalcMode(STCalcMode.AUTO);
        }
    }
View Full Code Here

     * @since 3.8
     */
    @Override
    public boolean getForceFormulaRecalculation(){
        CTWorkbook ctWorkbook = getCTWorkbook();
        CTCalcPr calcPr = ctWorkbook.getCalcPr();
        return calcPr != null && calcPr.getCalcId() != 0;
    }
View Full Code Here

        CTWorkbook ctWorkbook = wb.getCTWorkbook();
        assertFalse(ctWorkbook.isSetCalcPr());

        wb.setForceFormulaRecalculation(true); // resets the EngineId flag to zero

        CTCalcPr calcPr = ctWorkbook.getCalcPr();
        assertNotNull(calcPr);
        assertEquals(0, (int) calcPr.getCalcId());

        calcPr.setCalcId(100);
        assertTrue(wb.getForceFormulaRecalculation());

        wb.setForceFormulaRecalculation(true); // resets the EngineId flag to zero
        assertEquals(0, (int) calcPr.getCalcId());
        assertFalse(wb.getForceFormulaRecalculation());
    }
View Full Code Here

     * this worksheet values when the workbook is opened
     *
     * @see org.apache.poi.ss.usermodel.Workbook#setForceFormulaRecalculation(boolean)
     */
    public void setForceFormulaRecalculation(boolean value) {
        CTCalcPr calcPr = getWorkbook().getCTWorkbook().getCalcPr();

        if(worksheet.isSetSheetCalcPr()) {
          // Change the current setting
          CTSheetCalcPr calc = worksheet.getSheetCalcPr();
          calc.setFullCalcOnLoad(value);
       }
       else if(value) {
          // Add the Calc block and set it
          CTSheetCalcPr calc = worksheet.addNewSheetCalcPr();
          calc.setFullCalcOnLoad(value);
       }
        if(value && calcPr != null && calcPr.getCalcMode() == STCalcMode.MANUAL) {
            calcPr.setCalcMode(STCalcMode.AUTO);
        }

    }
View Full Code Here

        CTWorkbook ctWorkbook = wb.getCTWorkbook();
        assertFalse(ctWorkbook.isSetCalcPr());

        wb.setForceFormulaRecalculation(true); // resets the EngineId flag to zero

        CTCalcPr calcPr = ctWorkbook.getCalcPr();
        assertNotNull(calcPr);
        assertEquals(0, (int) calcPr.getCalcId());

        calcPr.setCalcId(100);
        assertTrue(wb.getForceFormulaRecalculation());

        wb.setForceFormulaRecalculation(true); // resets the EngineId flag to zero
        assertEquals(0, (int) calcPr.getCalcId());
        assertFalse(wb.getForceFormulaRecalculation());

        // calcMode="manual" is unset when forceFormulaRecalculation=true
        calcPr.setCalcMode(STCalcMode.MANUAL);
        wb.setForceFormulaRecalculation(true);
        assertEquals(STCalcMode.AUTO, calcPr.getCalcMode());

    }
View Full Code Here

TOP

Related Classes of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTCalcPr

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.