Is there a way to change the page size and layout while creating the Excel document using Apache POI? The default one is A4-vertical, while I need A6-horizontal (landscape).
I don't think that this question requires code sample, the Excel document is created just as described in the manual:
Workbook wb = new HSSFWorkbook();
Sheet sheet = wb.createSheet("new sheet");
sheet.getPrintSetup().setLandscape(true);
sheet.getPrintSetup().setPaperSize(HSSFPrintSetup.A5_PAPERSIZE);
HSSFPrinterSetup Javadoc
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With