Skip to content

Conversation

@9thbit
Copy link
Contributor

@9thbit 9thbit commented Jun 27, 2018

This will result in the sheet having dropdown filters in the first header row.

screen shot 2018-06-27 at 09 30 51

Let me know if you prefer to use a different syntax or API to enable this.

This will result in the sheet having dropdown filters in the first header row.
Copy link
Collaborator

@kevmo314 kevmo314 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the change!

def get_auto_filter_xml_string(self):
if self.auto_filter:
return '<autoFilter ref="{}"/>'.format(
Range.Range((1, 1), (self.num_rows, self.num_columns), self)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is <autoFilter> with a non-encompassing range valid? It seems like it may be better to have the auto_filter property take a Range or boolean type, with the latter setting it as the entire worksheet. My guess is a @property and @auto_filter.setter will end up being cleaner.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be honest I do not know the precise specification of what is allowable, I simply got this from reversing what Excel did when toggling on the feature. I'll investigate when I get a chance and get back to you.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok so I took a look at the open office spec regarding <autoFilter>, turns out it can take on quite a few values, including have child elements to support more complex filtering.

Your use case is probably the most common though, and I'm assuming you'd like to have it in the lib, so we can merge the PR as-is and we'll take a look at adding support for all the other stuff in a future change. :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much @kevmo314 👍

@kevmo314 kevmo314 merged commit 8135eae into kz26:dev Jun 30, 2018
@9thbit 9thbit deleted the auto-filter branch July 3, 2018 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants