开发者

Apache POI: change page format for Excel worksheet

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 (开发者_JS百科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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜