fix: Export excel file can running instructions(csv no need deal)

pull/13001/head
Bai 2024-04-11 20:12:56 +08:00 committed by Bryan
parent 0adc854721
commit 3f67b40975
1 changed files with 3 additions and 1 deletions

View File

@ -25,7 +25,9 @@ class ExcelFileRenderer(BaseFileRenderer):
# 处理非法字符
column_count += 1
cell_value = ILLEGAL_CHARACTERS_RE.sub(r'', str(cell_value))
self.ws.cell(row=self.row_count, column=column_count, value=str(cell_value))
cell = self.ws.cell(row=self.row_count, column=column_count, value=str(cell_value))
# 设置单元格格式为纯文本, 防止执行公式
cell.data_type = 's'
def after_render(self):
for col in self.ws.columns: