Example usage for org.apache.poi.ss.usermodel PrintSetup setNotes

List of usage examples for org.apache.poi.ss.usermodel PrintSetup setNotes

Introduction

In this page you can find the example usage for org.apache.poi.ss.usermodel PrintSetup setNotes.

Prototype

void setNotes(boolean printnotes);

Source Link

Document

Print the include notes

Usage

From source file:org.pentaho.reporting.engine.classic.core.modules.output.table.xls.helper.ExcelPrinterBase.java

License:Open Source License

protected void configureSheetPaperSize(final Sheet sheet, final PhysicalPageBox page) {
    Configuration config = getConfig();
    final String paper = config
            .getConfigProperty("org.pentaho.reporting.engine.classic.core.modules.output.table.xls.Paper");
    final String orientation = config.getConfigProperty(
            "org.pentaho.reporting.engine.classic.core.modules.output.table.xls.PaperOrientation");
    final short scale = (short) ParserUtil.parseInt(
            config.getConfigProperty(/* ww w  .  j  ava  2  s  . c  o m*/
                    "org.pentaho.reporting.engine.classic.core.modules.output.table.xls.PrintScaleFactor"),
            100);
    final short hres = (short) ParserUtil.parseInt(config.getConfigProperty(
            "org.pentaho.reporting.engine.classic.core.modules.output.table.xls.PrintHorizontalResolution"),
            -1);
    final short vres = (short) ParserUtil.parseInt(config.getConfigProperty(
            "org.pentaho.reporting.engine.classic.core.modules.output.table.xls.PrintVerticalResolution"), -1);
    final boolean noColors = "true".equals(config.getConfigProperty(
            "org.pentaho.reporting.engine.classic.core.modules.output.table.xls.PrintNoColors"));
    final boolean notes = "true".equals(config.getConfigProperty(
            "org.pentaho.reporting.engine.classic.core.modules.output.table.xls.PrintNotes"));
    final boolean usePage = "true".equals(config.getConfigProperty(
            "org.pentaho.reporting.engine.classic.core.modules.output.table.xls.PrintUsePage"));
    final boolean draft = "true".equals(config.getConfigProperty(
            "org.pentaho.reporting.engine.classic.core.modules.output.table.xls.PrintDraft"));

    final PrintSetup printSetup = sheet.getPrintSetup();
    ExcelPrintSetupFactory.performPageSetup(printSetup, page, paper, orientation);
    printSetup.setScale(scale);
    printSetup.setNoColor(noColors);
    printSetup.setNotes(notes);
    printSetup.setUsePage(usePage);
    if (hres > 0) {
        printSetup.setHResolution(hres);
    }
    if (vres > 0) {
        printSetup.setVResolution(vres);
    }
    printSetup.setDraft(draft);

    final boolean displayGridLines = "true".equals(config.getConfigProperty(
            "org.pentaho.reporting.engine.classic.core.modules.output.table.xls.GridLinesDisplayed"));
    final boolean printGridLines = "true".equals(config.getConfigProperty(
            "org.pentaho.reporting.engine.classic.core.modules.output.table.xls.GridLinesPrinted"));
    sheet.setDisplayGridlines(displayGridLines);
    sheet.setPrintGridlines(printGridLines);
}