reactjs - error200280_01.xml - Ag Grid Excel Export - error after downloading the excel - Stack Overflow

I have implemented export to excel for ag grid with version "ag-grid-react": "^33.0.3&qu

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条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信