We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Export to excel including detail template

Hi,

I have read the solution on exporting detail template to excel on grid. but, still I don't understand and not sure if it is doable in EJ2. Hope you can help me with sample on how to export my grid to excel including grid that has detail template. FYI, I'm using method of exporting multiple grid data in the same excel. the file is downloaded well but without detail template. appreciate if you can help me :)  below is the code to download multiple grid in same sheet.


<script>
    function toolbarClick(args) {
            var firstGrid = document.getElementById("List_Declaration_Info").ej2_instances[0];
            var secondGrid = document.getElementById("List_Invoice_Info").ej2_instances[0];
            var thirdGrid = document.getElementById("List_Vehicles_Info").ej2_instances[0];
            var fourthGrid = document.getElementById("List_Containers_Info").ej2_instances[0];
            var appendExcelExportProperties = {
                multipleExport: { type: 'AppendToSheet', blankRows: 2 }
            };

            var GridExport = firstGrid.excelExport(appendExcelExportProperties, true);

            GridExport.then((fData) => {
                secondGrid.excelExport(appendExcelExportProperties, true, fData).then((fkData) => {
                    thirdGrid.excelExport(appendExcelExportProperties, true, fkData).then((fData) => {
                        fourthGrid.excelExport(appendExcelExportProperties, false, fData);
                    })
                });
                
                
            });
    }
</script>


regards,


afiq

1 Reply

PS Pavithra Subramaniyam Syncfusion Team March 29, 2019 09:06 AM UTC

Hi Afiq, 
 
Greetings from Syncfusion. 
 
Query #1: Export to excel including detail template 
 
We have analyzed your query but we do not have support to export detail template of the grid component as the template may almost contain anything(text, image, etc.). So if you have bind a grid component in the detail, then we suggest to use the hierarchy grid export, please refer to the below sample for your reference, 
 
 
 
Please get back to us for further assistance. 
 
Regards, 
Pavithra S. 
 


Loader.
Live Chat Icon For mobile
Up arrow icon