Export to excel with aggregates

I have a grid that has a column in the aggregate to make the total sum, and when I try to export the error, if I remove the aggregate column, it exports correctly, what should I do?

            <e-aggregates>
                <e-aggregate>
                    <e-columns>
                        <e-column type="Sum" field="valor" format='C2' :footerTemplate='footerSum'></e-column>
                    </e-columns>
                </e-aggregate>
            </e-aggregates>



excel-export.js?6e1f:720 Uncaught (in promise) TypeError: Cannot read property 'textContent' of undefined
    at ExcelExport.getAggreateValue (excel-export.js?6e1f:720)
    at ExcelExport.fillAggregates (excel-export.js?6e1f:616)
    at ExcelExport.processAggregates (excel-export.js?6e1f:590)
    at ExcelExport.processRecordContent (excel-export.js?6e1f:367)
    at ExcelExport.processGridExport (excel-export.js?6e1f:341)
    at eval (excel-export.js?6e1f:229)
    at new Promise (<anonymous>)
    at ExcelExport.processInnerRecords (excel-export.js?6e1f:227)
    at eval (excel-export.js?6e1f:154)


Thanks!

5 Replies 1 reply marked as answer

MS Manivel Sellamuthu Syncfusion Team November 9, 2020 01:22 PM UTC

Hi Murilo, 

Greetings from Syncfusion support. 

Before proceeding your query, Could you please share the below details, which will be helpful for us to validate further about issue. 

  1. Share the complete Grid code (including grid datasource model)
  2. Syncfusion package version
  3. If possible, please share the issue reproducible sample.

Regards, 
Manivel 



MU Murilo November 9, 2020 02:59 PM UTC

I created this example application, but I don't want to show the sum in the footer, but the problem is that if I show the footer I can't export it.

Attachment: aggregateexport_1456b60e.rar


RS Rajapandiyan Settu Syncfusion Team November 10, 2020 01:34 PM UTC

Hi Murilo, 
 
Thanks for your update. 
 
We have validated your query and run the attached sample. Exporting is working fine in your project. 
 
By further validation, we found that the template complier is not working properly in your project. When we run the project it throws the below issue. 
 
 
 
So, the aggregate with footerTemplate is not rendered in your Grid and its exports weird value for aggregate cell. 
 
Since the above issue is a common issue. You can resolve this by referring below links. 
 
 
 
 
Please find the below working sample for your reference. 
 
  
Please get back to us if you need further assistance with this. 
 
Regards, 
Rajapandiyan S 


Marked as answer

MU Murilo November 12, 2020 12:20 AM UTC

I added all the settings and in my project it didn't work.
"runtimeCompiler: true," etc ..

is it possible to disable aggregate export?


MS Manivel Sellamuthu Syncfusion Team November 12, 2020 12:27 PM UTC

Hi Murilo, 

Thanks for your update. 

We have validated your requirement and it is not feasible to disable the aggregates while exporting. 

We suggest you to try the attached sample in our previous update to resolve the issue. If you still faced the issue , please share the issue replication sample for further validation. 

Regards, 
Manivel 


Loader.
Up arrow icon