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

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


    }
    styleSheet.setNumFmts(formats);

    int idx;
    // Fonts
    CTFonts ctFonts = CTFonts.Factory.newInstance();
    ctFonts.setCount(fonts.size());
    CTFont[] ctfnt = new CTFont[fonts.size()];
    idx = 0;
    for(XSSFFont f : fonts) ctfnt[idx++] = f.getCTFont();
    ctFonts.setFontArray(ctfnt);
    styleSheet.setFonts(ctFonts);

    // Fills
    CTFills ctFills = CTFills.Factory.newInstance();
    ctFills.setCount(fills.size());
View Full Code Here


    // Formats
    CTNumFmts formats = CTNumFmts.Factory.newInstance();
    formats.setCount(numberFormats.size());
    for (Entry<Integer, String> fmt : numberFormats.entrySet()) {
      CTNumFmt ctFmt = formats.addNewNumFmt();
      ctFmt.setNumFmtId(fmt.getKey());
      ctFmt.setFormatCode(fmt.getValue());
    }
    styleSheet.setNumFmts(formats);

    int idx;
    // Fonts
View Full Code Here

      doc = StyleSheetDocument.Factory.parse(is);

            CTStylesheet styleSheet = doc.getStyleSheet();

            // Grab all the different bits we care about
      CTNumFmts ctfmts = styleSheet.getNumFmts();
            if( ctfmts != null){
                for (CTNumFmt nfmt : ctfmts.getNumFmtArray()) {
                    numberFormats.put((int)nfmt.getNumFmtId(), nfmt.getFormatCode());
                }
            }

            CTFonts ctfonts = styleSheet.getFonts();
View Full Code Here

    // Need to do this, as we don't handle
    //  all the possible entries yet
        CTStylesheet styleSheet = doc.getStyleSheet();

    // Formats
    CTNumFmts formats = CTNumFmts.Factory.newInstance();
    formats.setCount(numberFormats.size());
    for (Entry<Integer, String> fmt : numberFormats.entrySet()) {
      CTNumFmt ctFmt = formats.addNewNumFmt();
      ctFmt.setNumFmtId(fmt.getKey());
      ctFmt.setFormatCode(fmt.getValue());
    }
    styleSheet.setNumFmts(formats);
View Full Code Here

    /**
     * Determine whether printed output for this sheet will be horizontally centered.
     */
    public boolean getHorizontallyCenter() {
        CTPrintOptions opts = worksheet.getPrintOptions();
        return opts != null && opts.getHorizontalCentered();
    }
View Full Code Here

     * Determine whether printed output for this sheet will be vertically centered.
     *
     * @return whether printed output for this sheet will be vertically centered.
     */
    public boolean getVerticallyCenter() {
        CTPrintOptions opts = worksheet.getPrintOptions();
        return opts != null && opts.getVerticalCentered();
    }
View Full Code Here

     * Returns whether gridlines are printed.
     *
     * @return whether gridlines are printed
     */
    public boolean isPrintGridlines() {
        CTPrintOptions opts = worksheet.getPrintOptions();
        return opts != null && opts.getGridLines();
    }
View Full Code Here

     * Turns on or off the printing of gridlines.
     *
     * @param value boolean to turn on or off the printing of gridlines
     */
    public void setPrintGridlines(boolean value) {
        CTPrintOptions opts = worksheet.isSetPrintOptions() ?
                worksheet.getPrintOptions() : worksheet.addNewPrintOptions();
        opts.setGridLines(value);
    }
View Full Code Here

     * Center on page horizontally when printing.
     *
     * @param value whether to center on page horizontally when printing.
     */
    public void setHorizontallyCenter(boolean value) {
        CTPrintOptions opts = worksheet.isSetPrintOptions() ?
                worksheet.getPrintOptions() : worksheet.addNewPrintOptions();
        opts.setHorizontalCentered(value);
    }
View Full Code Here

     * Whether the output is vertically centered on the page.
     *
     * @param value true to vertically center, false otherwise.
     */
    public void setVerticallyCenter(boolean value) {
        CTPrintOptions opts = worksheet.isSetPrintOptions() ?
                worksheet.getPrintOptions() : worksheet.addNewPrintOptions();
        opts.setVerticalCentered(value);
    }
View Full Code Here

TOP

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

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.