Cells with German umlauts (ä, ö, ü) are ignored
Hi
We are trying to export the content of an ag-grid table to an xlsx file. We use the following steps (based on the ag-grid docs https://www.ag-grid.com/javascript-grid-excel/#sheetjs-custom-xlsx-export-example-without-styles):
const dataAsExcel = gridApi.getDataAsExcel(excelExportParams);
const workBook = XLSX.read(dataAsExcel, {type: 'binary'});
const xlsxContent = XLSX.write(workBook, {type: 'base64'});`
The table potentially contains German umlauts (dataAsExcel contains the umlauts)
<Cell>
<Data ss:Type="String">The german umlaut ä</Data>
</Cell>
But as soon as we call XSLX.read all cells with umlauts are empty. The workBook field does not even contain entries for the affected cells.
Is there anything we are doing wrong?
Thanks in advance! Marius
type should be "string":
const workBook = XLSX.read(dataAsExcel, {type: 'binary'});
An issue was raised against their documentation: https://github.com/ag-grid/ag-grid-docs/issues/180
Works like a charm! Thanks.
What must be added if type: 'array' is used?
XLSX.read(data, {type: 'array'});