Search code examples
reactjsexcelsyncfusion

Export multiple grid to excel from syncfusion grid


Is it possible to export multiple grid, more than two, in a single sheet in excel export? The documentation is for two grids but I want to create a single excel file with one sheet which needs to have multiple grid/table. I have a few of these tables.

enter image description here

I was able to use upto two tables only from the documentation.

if (gridRef) {
        const appendExcelExportProperties = {
            multipleExport: { type: 'AppendToSheet', blankRows: 2 },
        };
        const masterGridRefExport = gridRef.masterGrid.excelExport(
            appendExcelExportProperties,
            true,
        );
        masterGridRefExport.then((fData) => {
            if (gridRef.addressGrid) {
                gridRef.addressGrid.excelExport(appendExcelExportProperties, false, fData);
            }
        });
    }

Solution

  • You like to export more than two Grids in a single sheet. Based on your query sample has been prepared and suggest you use the below method to achieve your requirement. Please refer the below code example and sample for more information.

    enter image description here

    Sample: https://stackblitz.com/edit/react-zbhoaz-qpwsxu?file=index.js,data.js

    Screenshot:

    enter image description here