Bug 35125 - implementing autofilter support
Summary: implementing autofilter support
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: unspecified
Hardware: Other other
: P2 normal with 31 votes (vote)
Target Milestone: ---
Assignee: POI Developers List
Depends on:
Reported: 2005-05-30 19:36 UTC by angel
Modified: 2016-05-03 15:07 UTC (History)
2 users (show)


Note You need to log in before you can comment on or make changes to this bug.
Description Sander Temme 2005-07-02 00:48:47 UTC
This information has been removed as its provenance was unclear. The contributor has been contacted.
Comment 1 Dominic Adatia 2008-06-09 06:38:01 UTC
Any progress on this..
Comment 2 Andy 2009-08-10 09:09:24 UTC
Here is a PERL version which can write autofilters: http://search.cpan.org/~jmcnamara/Spreadsheet-WriteExcel-2.25/lib/Spreadsheet/WriteExcel.pm

Basically one has to write an AutofilterinfoRecord which contains the number of filters. Additionally one has to create an MSODRAWING and an OBJ for each col containing a filter. Sadly, excel always crashes when it tries to read my testfile, although, in BiffViewer they look almost identical to a dump what excel generated.

I can provide my testcode which was hacked against the 3.2 FINAL. I also welcome any tipps ;-)
Comment 3 Yegor Kozlov 2010-08-10 02:36:51 UTC
Initial support for auto-filters was committed in r983382.
To test-drive you need to build poi from trunk or download the latest daily build from http://encore.torchbox.com/poi-svn-build/

In current version you can only apply auto-filter on a range of cells:


Customizing of auto-filter properties (filter criteria, sort, etc.) is not yet supported. The feature is available both for HSSF and XSSF.

Comment 4 Sangeetha 2016-05-03 10:33:54 UTC
Hi Yegor Kozlov,

I need to custom filter the value of a column(based on one of the value of the column) after applying the auto-filter.

The below method helps me to apply autofilter for the columns A3 through E3

But if I use the same method for custom filtering, like below. It doesn't work.
In this case, I want to filter the rows for the value of column E3 as "Near End" 
sheet.setAutoFilter(CellRangeAddress.valueOf("E3:Near End"));
It did not work and throws - java.lang.IllegalArgumentException error.

I tried to use the HSSFAutoFilter class like below, with method 'equals'. It also did not work.
HSSFAutoFilter autofilter;
autofilter = sheet.setAutoFilter(CellRangeAddress.valueOf("E3"));
autofilter.equals("Near End");

Is the custom filtering supported in HSSFAutoFilter for HSSFSheet?
If not supported now, when it will be available. I am using the poi 3.15 JAR files.

Is there any other way for this. Please provide information on this.
Comment 5 Dominik Stadler 2016-05-03 15:07:27 UTC
Please note that reopening such an old bug requires developers and interested people to sift through old discussion that is likely not relevant any more. REOPEN means the original bugfix was broken and should be redone. 

Otherwise it is usually better to create a new bug where you describe your problem and improvement suggestions. You can link back to this bug-entry for reference there. 

For general usage questions the mailing lists are much better suited.

Therefore I am setting this one back to FIXED for now.