poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 56375] New: Autofilter : wrong definition created _FilterDatabase built-in name in HSSFSheet.setAutoFilter()
Date Wed, 09 Apr 2014 12:34:24 GMT
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: dev@poi.apache.org
          Reporter: jrsirieix@free.fr

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: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Mime
View raw message