本文整理汇总了Java中org.apache.poi.ss.usermodel.PrintSetup.A4_PAPERSIZE属性的典型用法代码示例。如果您正苦于以下问题:Java PrintSetup.A4_PAPERSIZE属性的具体用法?Java PrintSetup.A4_PAPERSIZE怎么用?Java PrintSetup.A4_PAPERSIZE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.apache.poi.ss.usermodel.PrintSetup
的用法示例。
在下文中一共展示了PrintSetup.A4_PAPERSIZE属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setPaperSize
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;
} 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);
}
}
示例2: getPaperSizeFromString
/**
* Convert a BIRT paper size string into a POI PrintSetup.*PAPERSIZE constant.
* @param name
* The paper size as a BIRT string.
* @return
* A POI PrintSetup.*PAPERSIZE constant.
*/
public short getPaperSizeFromString( String name ) {
if( "a4".equals(name) ) {
return PrintSetup.A4_PAPERSIZE;
} else if( "a3".equals(name)) {
return PrintSetup.A3_PAPERSIZE;
} else if( "us-letter".equals(name)) {
return PrintSetup.LETTER_PAPERSIZE;
}
return PrintSetup.A4_PAPERSIZE;
}