Category Archives: autofilter

Apache POI – how to check if auto filter has one or more value selected reading an excel file

This is my first question, so be patient. I already searched and googled, but I didn't find anything. I have a Java project which uses Apache POI v3.10 final, which I could update if necessary. My issue is releated to auto-filters. I know that generating an excel you can set auto-filter.but in my case I'm reading an excel file and I would like to check if there are any active auto filters, non only if there auto filters, but also if the users selected some values to filter the rows and then saved the excel with filtered rows, so I can show a warning message.

I know you can retrieve row height (row.getHeight() or row.getZeroHeight()) but it is not really the same. I also found AutoFilterInfoRecord class, which I can retrieve from InternalSheet (through reflection) from HSSFSheet, but that class can only tell me if there are any autofilters.