-
Bug
-
Resolution: Fixed
-
Major
-
5.11.0
-
None
-
Security Level: Jimmy
-
None
-
None
Steps to Reproduce
Import an empty excel sheet with 3 tabs (sample attached defaulttab.xlsx).
Before importing the active sheet is sheet 1
immediately exporter the same book with excel exporter
Current Result
When opening the file in Excel, the last visible sheet is always set as active (sheet 3).
In addition, sheet 1 is not active, but is selected
Expected Result
Sheet 1 should still be the active sheet
Debug Information
In Excel exporter io.keikai.range.impl.imexp.AbstractExcelExporter.export(SBook, OutputStream)
if (sheet.getSheetVisible() == SSheet.SheetVisible.VISIBLE || sheet.getViewInfo().isTabSelected()) {
_exportPhase.setPhase(ExportPhase.SHEET_ACTIVE);
workbook.setActiveSheet(n);
_exportPhase.setPhase(ExportPhase.SHEET);
}
workbook.setActiveSheet( n ) is called on every sheet that is either visible (as in, not hidden in the sheet list), or currently selected.
This means that this line is called for every sheet that is not specifically hidden, which always sets the last "non hidden" sheet as the active sheet, even though this is not the same active sheet a imported.
Workaround
replace exporter (attached)
- relates to
-
KEIKAI-486 export a hidden sheet as a visible sheet
- Closed
-
KEIKAI-757 Sheet Selection Overridden by Internal Event When Hiding a Sheet
- Closed