Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

multiple autofilters for the same EPPlus worksheet

Im creating an xlsx-file using EPPlus and want to have autofilters for all headers. I set the autofilters like this:

worksheet.Cells["A3:G" + (3 + data.Count).ToString()].AutoFilter = true;

This works smooth for just one table of content. However, I have two separate tables in the same worksheet, and when trying to set autofilters for the second one, the autofilters for the first one disappears.

Any known workarounds for this, or other suggestions?

like image 295
Hans Petter Naumann Avatar asked Apr 14 '14 11:04

Hans Petter Naumann


1 Answers

This is a very good question!

A traditional limitation of AutoFilter is that it can be applied only once on a worksheet.

Starting with Excel 2007 you can create several Tables on a worksheet...........each with filtering capabilities.

See Pieterse's Article

like image 169
Gary's Student Avatar answered Oct 09 '22 12:10

Gary's Student