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

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

Introduction

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

Prototype

short LEGAL_PAPERSIZE

To view the source code for org.apache.poi.ss.usermodel PrintSetup LEGAL_PAPERSIZE.

Click Source Link

Document

US Legal 8 1/2 x 14 in

Usage

From source file:ro.nextreports.engine.exporter.XlsExporter.java

License:Apache License

private void setPaperSize() {
    String pageFormat = bean.getReportLayout().getPageFormat();
    short size = 0;
    if (ReportLayout.LETTER.equals(pageFormat)) {
        size = PrintSetup.LETTER_PAPERSIZE;
    } else if (ReportLayout.A3.equals(pageFormat)) {
        size = PrintSetup.A3_PAPERSIZE;//from   www  . j a  va  2 s.c o  m
    } else if (ReportLayout.A4.equals(pageFormat)) {
        size = PrintSetup.A4_PAPERSIZE;
    } else if (ReportLayout.LEGAL.equals(pageFormat)) {
        size = PrintSetup.LEGAL_PAPERSIZE;
    } else if (ReportLayout.LEDGER.equals(pageFormat)) {
        size = PrintSetup.LEDGER_PAPERSIZE;
    } else if (ReportLayout.TABLOID.equals(pageFormat)) {
        size = PrintSetup.TABLOID_PAPERSIZE;
    }
    if (size != 0) {
        xlsSheet.getPrintSetup().setPaperSize(size);
    }
}