Set page view mode in excel file using apache poi

后端 未结 1 1423
名媛妹妹
名媛妹妹 2020-12-21 18:02

Excel has different modes for viewing a sheet: Normal, Page Layout, Page Break Preview. (In excel 2010: in the view tab). The view mode is saved seperately for each sheet in

1条回答
  •  生来不讨喜
    2020-12-21 18:29

    XSSF doesn't expose this directly, but you can get at it if you want

    From the XSSFSheet object, call getCTWorksheet to get the low level XML object backing the sheet. CTWorksheet provides a getSheetViews method. You'll like want something like:

     CTSheetView view = sheet.getCTWorksheet().getSheetViews().getSheetViewArray(0);
     view.setView(STSheetViewType.PAGE_LAYOUT);
    

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