We have encountered a bug when attempting to set the view type to Page Layout view for XLSB files. The following code works as expected for XLS, XLSX and XLSM files, but produces no effect in the case of XLSB files:
public void saveInPageLayoutView(final String inFile, final String outFile) throws Exception { final Workbook workbook = new Workbook(inFile); for (Object sheetObject : workbook.getWorksheets()) { final Worksheet sheet = (Worksheet) sheetObject; sheet.setViewType(ViewType.PAGE_LAYOUT_VIEW); } workbook.save(outFile); }
I have attached the input files we used for testing and the output files resulted in each case.
We would appreciate any help or workaround in order to have the processed XLSB file open in Page Layout View, like the other Excel types do.
After an initial test, I observed the issue as you mentioned by using your template XLSB file with your sample code. I found an issue with setting Page Layout View for XLSB files, it works fine for XLSX files though. I have logged a ticket with an id “CELLSJAVA-42220” for your issue. We will look into it soon.
Once we have an update on it, we will let you know here.
This is to inform you that we have fixed your issue CELLSJAVA-42220 now. We will soon provide the fix after performing QA and including other enhancements and fixes.
Good to know that your issue is sorted out by the new fix/version.
Well, you may use this fix for your product server as it has all the fixes/enhancements and functionality full fledged of previous official release v17.3.0 till this fix. However, our next official release of the product i.e., Aspose.Cells for Java v17.4.0 will include this fix. The next official release might be released in the third or fourth week of next month.