Hi,
I'm having an issue with the grid control, initially, the export to pdf is working fine, then after I add grouping and aggregation, I get an error once I try to export
Hi Abdul,
Greetings from Syncfusion support.
We have prepared a sample of EJ2 Grid with grouping and aggregates in it. We were not able to reproduce the issue you are facing when exporting to pdf. Refer the below sample and try to reproduce the issue in the sample below or share a simple sample to reproduce the issue.
Sample: https://stackblitz.com/edit/sn4qyv?file=index.js
Regards,
Joseph I.
Hi,
Pls check my configuration and see how the error will happen
https://stackblitz.com/edit/sn4qyv-aqkbgf?file=index.js
We do have huge data, so we made the aggregation in the caption and in the footer, here the problem start
Abdul,
By default, the aggregate value can be displayed in the footer, group, and caption cells. To show the aggregate value in one of the cells, use the footerTemplate, groupFooterTemplate, or groupCaptionTemplate property. It is not correct to define both groupFooterTemplate and groupCaptionTemplate in the same object as it will be displayed in different cells.
Refer the below code example
aggregates: [ { columns: [ { type: 'Sum', field: 'UnitsInStock', groupCaptionTemplate: 'Total units: ${Sum}', }, { type: 'Sum', field: 'UnitsInStock', groupFooterTemplate: 'Total units: ${Sum}', }, { type: 'TrueCount', field: 'Discontinued', groupCaptionTemplate: 'Discontinued: ${TrueCount}', }, { type: 'TrueCount', field: 'Discontinued', groupFooterTemplate: 'Discontinued: ${TrueCount}', }, ],
|
Sample: https://stackblitz.com/edit/sn4qyv-zx26ya?file=index.js
Documentaiton: https://ej2.syncfusion.com/javascript/documentation/grid/aggregates/aggregates/
Hi,
Thanks for the details, this resolves the issue 🥳🥳🥳
Abdul,
We are glad that the provided solution helped to solve the issue. Please get back to us for further assistance.
We are marking this ticket as solved.
Regards,
Suganya Gopinath.