add filter
Showing
1 changed file
with
4 additions
and
1 deletions
... | @@ -7,7 +7,7 @@ from pandas._libs import tslib | ... | @@ -7,7 +7,7 @@ from pandas._libs import tslib |
7 | from pandas._libs.tslibs.nattype import NaTType | 7 | from pandas._libs.tslibs.nattype import NaTType |
8 | from pandas.core.indexes.datetimes import DatetimeIndex | 8 | from pandas.core.indexes.datetimes import DatetimeIndex |
9 | from openpyxl import Workbook | 9 | from openpyxl import Workbook |
10 | from openpyxl.styles import Border, Side, PatternFill, numbers | 10 | from openpyxl.styles import PatternFill, numbers |
11 | from openpyxl.utils import get_column_letter | 11 | from openpyxl.utils import get_column_letter |
12 | from apps.doc import consts | 12 | from apps.doc import consts |
13 | 13 | ||
... | @@ -452,6 +452,9 @@ class BSWorkbook(Workbook): | ... | @@ -452,6 +452,9 @@ class BSWorkbook(Workbook): |
452 | amount_fill_row = set() | 452 | amount_fill_row = set() |
453 | loan_fill_row = set() | 453 | loan_fill_row = set() |
454 | 454 | ||
455 | # 添加筛选 | ||
456 | new_ws.auto_filter.ref = 'A1:{0}{1}'.format(get_column_letter(new_ws.max_column), new_ws.max_row) | ||
457 | |||
455 | for rows in new_ws.iter_rows(min_row=2): | 458 | for rows in new_ws.iter_rows(min_row=2): |
456 | length = len(rows) | 459 | length = len(rows) |
457 | summary_cell = None if summary_cell_idx is None or summary_cell_idx >= length else rows[summary_cell_idx] | 460 | summary_cell = None if summary_cell_idx is None or summary_cell_idx >= length else rows[summary_cell_idx] | ... | ... |
-
Please register or sign in to post a comment