From b096b3d9a597c661b954e696040aeb6ad20f3440 Mon Sep 17 00:00:00 2001 From: Ghislain Beaulac Date: Wed, 17 Jun 2020 13:22:20 -0400 Subject: [PATCH] fix(excel): Excel Export add mime type to work in Firefox, fixes #500 --- .../modules/angular-slickgrid/services/excelExport.service.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/modules/angular-slickgrid/services/excelExport.service.ts b/src/app/modules/angular-slickgrid/services/excelExport.service.ts index 350f0c206..bcf6819e9 100644 --- a/src/app/modules/angular-slickgrid/services/excelExport.service.ts +++ b/src/app/modules/angular-slickgrid/services/excelExport.service.ts @@ -130,7 +130,8 @@ export class ExcelExportService { this._sheet.setData(finalOutput); this._workbook.addWorksheet(this._sheet); - const excelBlob = await ExcelBuilder.Builder.createFile(this._workbook, { type: 'blob' }); + const mimeType = this._fileFormat === FileType.xls ? 'application/vnd.ms-excel' : 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet '; + const excelBlob = await ExcelBuilder.Builder.createFile(this._workbook, { type: 'blob', mimeType }); const downloadOptions = { filename: `${this._excelExportOptions.filename}.${this._fileFormat}`, format: this._fileFormat