Apache POI: change page format for Excel worksheet

后端 未结 1 2003
没有蜡笔的小新
没有蜡笔的小新 2021-01-02 03:36

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).

1条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-02 04:05

    sheet.getPrintSetup().setLandscape(true);
    sheet.getPrintSetup().setPaperSize(HSSFPrintSetup.A5_PAPERSIZE); 
    

    HSSFPrinterSetup Javadoc

    0 讨论(0)
提交回复
热议问题