use of org.apache.poi.hssf.usermodel.HSSFPrintSetup in project adempiere by adempiere.
the class AbstractExcelExporter method formatPage.
protected void formatPage(HSSFSheet sheet) {
sheet.setFitToPage(true);
// Print Setup
HSSFPrintSetup ps = sheet.getPrintSetup();
ps.setFitWidth((short) 1);
ps.setNoColor(true);
ps.setPaperSize(HSSFPrintSetup.A4_PAPERSIZE);
ps.setLandscape(false);
}
use of org.apache.poi.hssf.usermodel.HSSFPrintSetup in project poi by apache.
the class TestPageSettingsBlock method testPrintSetup_bug46548.
public void testPrintSetup_bug46548() {
// PageSettingBlock in this file contains PLS (sid=x004D) record
// followed by ContinueRecord (sid=x003C)
HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("ex46548-23133.xls");
HSSFSheet sheet = wb.getSheetAt(0);
HSSFPrintSetup ps = sheet.getPrintSetup();
try {
ps.getCopies();
} catch (NullPointerException e) {
e.printStackTrace();
throw new AssertionFailedError("Identified bug 46548: PageSettingBlock missing PrintSetupRecord record");
}
}
Aggregations