https://bz.apache.org/bugzilla/show_bug.cgi?id=60651

            Bug ID: 60651
           Summary: Auto filter crashes excel when sorting
           Product: POI
           Version: 3.15-FINAL
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: HSSF
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

Created attachment 34681
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=34681&action=edit
This is the file that crashes.

I am having a crashing issue with excel after I add a auto filter thru java.
After adding the filter to excel columns if I open the excel sheet and attempt
to sort, using the drop down arrow on the column header, it crashes every time.
If I first filter, like unchecking the blanks option from the drop down, then I
can sort and use the sheet like normal with no crashes. If I try to sort using
the Sort & Filter button in the editing section at the top of excel it will
sort just fine but remove the auto filter. Also if I remove and re-add the
filter it doesn't crash and works as expected. Is there a way to make it to
where we can add the auto filter thru java then be able to sort before making
any other changes to the sheet? I have pasted my code below and I have attached
both the excel sheet that is create thru java and pre and post fixing it.


FileInputStream fileIn = new FileInputStream("C:\\Users\\gria\\Desktop\\Fleet
Manager Summary.xls");
                        HSSFWorkbook report = new HSSFWorkbook(fileIn);

                        Sheet sheet = report.getSheetAt(0);
                        sheet.setAutoFilter(CellRangeAddress.valueOf("A5:O5"));

                        FileOutputStream fileOut = new
FileOutputStream("C:\\Users\\gria\\Desktop\\Fleet Manager SummaryT.xls");
                        report.write(fileOut);
                        report.close();
                        fileOut.close();
                        fileIn.close();

-- 
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]

Reply via email to