From aee1a6caf8a9f41bcc09b976d77ea562b8d7a9d0 Mon Sep 17 00:00:00 2001 From: partizand Date: Fri, 8 Jun 2018 15:20:12 +0300 Subject: [PATCH] fix xlsxwriter api changes --- src/gnucashreport/xlsxreport.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/gnucashreport/xlsxreport.py b/src/gnucashreport/xlsxreport.py index 04be919..b9df1df 100644 --- a/src/gnucashreport/xlsxreport.py +++ b/src/gnucashreport/xlsxreport.py @@ -133,7 +133,7 @@ def _add_dataframe(self, df: pandas.DataFrame, format_report, startcol=None, sta # Имена индексов index_names = df.index.names # Установка ширины колонок индексов - self._worksheet.set_column(firstcol=col, lastcol=col + len(index_names) - 1, + self._worksheet.set_column(first_col=col, last_col=col + len(index_names) - 1, width=format_report.index_width) # Добавление названий индексов на лист self._append_line(index_names, row=row, col=col, cell_format=format_report.format_header) @@ -142,17 +142,17 @@ def _add_dataframe(self, df: pandas.DataFrame, format_report, startcol=None, sta # Названия полей columns = df.columns.tolist() # Установка ширины колонок полей - self._worksheet.set_column(firstcol=col, lastcol=col + len(columns) - 1, + self._worksheet.set_column(first_col=col, last_col=col + len(columns) - 1, width=format_report.column_width) # Ширина итоговых колонок if format_report.margins.empty_col: - self._worksheet.set_column(firstcol=col + len(columns) - vtotals, lastcol=col + len(columns) - vtotals, + self._worksheet.set_column(first_col=col + len(columns) - vtotals, last_col=col + len(columns) - vtotals, width=format_report.empty_width) - self._worksheet.set_column(firstcol=col + len(columns) - vtotals+1, lastcol=col + len(columns), + self._worksheet.set_column(first_col=col + len(columns) - vtotals+1, last_col=col + len(columns), width=format_report.total_width) elif vtotals > 0: - self._worksheet.set_column(firstcol=col + len(columns) - vtotals, lastcol=col + len(columns), + self._worksheet.set_column(first_col=col + len(columns) - vtotals, last_col=col + len(columns), width=format_report.total_width) # Добавление категорий в свойства графика categories = "='{sheet}'!${start_col}${start_row}:${end_col}${end_row}". \