Skip to content

Workaround needed for EPPlus' AutoFilter bug #28

@eobeda

Description

@eobeda

While trying to add support for anonymous types, I found an issue with the underlying Excel library that you might want to address with a workaround. It seams that version 3.1.3.0 of the EPPlus library does not support toggling of it's AutoFilter property. If you touch it, it will be set to true.

The quickest way to reproduce the issue is to set the autoFilter property of the XlsxMediaTypeFormatter to false in the sample code:

var formatter = new XlsxMediaTypeFormatter(
autoFilter: false, < ===== HERE
freezeHeader: true,

and run the sample. Upon opening the Excel spreadsheet, you'll see the filter dropdowns are still be displayed.

One possible workaround would be to wrap the call in an if statement:
if (AutoFilter) cells.AutoFilter = true;
(at Line 264 of XlsxMediaTypeFormatter.cs)

Hope this helps improve an already great formatter.
Ed

PS: Any interest in anonymous type support with optional per view configs ??

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions