https://issues.apache.org/bugzilla/show_bug.cgi?id=56375
Bug ID: 56375
Summary: Autofilter : wrong definition created _FilterDatabase
built-in name in HSSFSheet.setAutoFilter()
Product: POI
Version: unspecified
Hardware: PC
OS: Windows XP
Status: NEW
Severity: normal
Priority: P2
Component: HSSF
Assignee: [email protected]
Reporter: [email protected]
When setting autofilters on several tabs in a workbook, the _FilterDatabase
built-in name sometimes has a wrong definition, e.g. it points to another sheet
or no sheet at all. In that case, the filter dropdown buttons are present but
they do nothing.
I think the issue comes from the setAutoFilter() method in HSSFSheet, which
calls new Area3DPtg() with a sheetIndex whereas it seems to expect an
esternSheetIndex (line 2066 in v3.9):
Area3DPtg ptg = new Area3DPtg(range.getFirstRow(), range.getLastRow(),
range.getFirstColumn(), range.getLastColumn(),
false, false, false, false, sheetIndex);
I seem to have resolved the problem by replacing this line with the following:
short externSheetIndex =
_workbook.getWorkbook().checkExternSheet(sheetIndex);
Area3DPtg ptg = new Area3DPtg(range.getFirstRow(), range.getLastRow(),
range.getFirstColumn(), range.getLastColumn(),
false, false, false, false, externSheetIndex);
I have no simple code to reproduce the issue. Obviously it must happen when the
sheetIndex is different from the externSheetIndex.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]