I would like to export the data in excel. Refer below snippet.
import * as XLSX from 'xlsx';
import * as FS from 'fs';
export const myExportToExcel = (data, fileName) => {
XLSX.set_fs(FS);
const ws = XLSX.utils.json_to_sheet(data);
const wb = XLSX.utils.book_new();
XLSX.utils.book_append_sheet(wb, ws, 'Sheet1');
//XLSX.writeFile(wb, fileName || 'data.xlsx', { compression: true });
XLSX.writeFileXLSX(wb, fileName, { compression: true });
};
While running, clicking on the button it does not download excel file. There is no error in console as well.
Any idea, if i miss something or any other work around?