I have implemented export to excel for ag grid with version "ag-grid-react": "^33.0.3". Now, when we download the excel we are getting this error: We found a problem with some content in Report.xlsx. Do you want us to try recover as much as we can? If you trust the source of this workbook, click Yes.
When we check the log it says:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<recoveryLog xmlns=";>
<logFileName>error200280_01.xml</logFileName>
<summary>Errors were detected in file 'C:\Users\Filename.xlsx'</summary>
<repairedRecords>
<repairedRecord>Repaired Records: Cell information from /xl/worksheets/sheet1.xml part</repairedRecord>
</repairedRecords>
</recoveryLog>
Export to excel function:
function exportToExcel(props, fileName) {
// Validate and format data before exporting
const processCellCallback = (params) => {
let value = params.value;
if (value) {
// Ensure value is a string and remove any invalid characters
value = value.toString().replace(/[^\x20-\x7E]/g, '');
}
return value;
};
const params = {
processCellCallback: processCellCallback,
fileName: fileName,
sheetName: fileName,
};
props.api.exportDataAsExcel(params);
}
Even if we simply do:
gridApi.exportDataAsExcel();
We are getting the same issue. Reference: /
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744854414a4597321.html
评论列表(0条)