zhangyu836 / xltpl

A python module to generate xls/x files from a xls/x template.
MIT License
71 stars 17 forks source link

Auto filters not included in the output after rendering #10

Closed rosshug closed 1 year ago

rosshug commented 2 years ago

I created an xlsx template, with column headers in the first row, and set auto filters on (Data > Filter menu in Excel). The results after rendering were correct except that the auto filter was missing.

I corrected this in the package code on my PC by copying the auto_filter setting in basex.py, SheetBase.copy_sheet_settings() self.wtsheet.auto_filter = copy.copy(self.rdsheet.auto_filter)

This worked fine in my case, because I had filters on the first row, however it will not work properly if the result of rendering moves the position of the cells being filtered.

zhangyu836 commented 2 years ago

Support for auto filter has been added. Please upgrade you xltpl package.

rosshug commented 1 year ago

Thanks, works for me. Sorry about delay on closing.