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

Cannot export to PDF with Grouping and Aggregation

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



5 Replies 1 reply marked as answer

JC Joseph Christ Nithin Issack Syncfusion Team November 18, 2022 07:07 AM

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.



AM Abdul Mounem November 18, 2022 07:13 AM

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



JC Joseph Christ Nithin Issack Syncfusion Team November 22, 2022 02:18 PM

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/



Marked as answer

AM Abdul Mounem November 22, 2022 02:41 PM

Hi,

Thanks for the details, this resolves the issue 🥳🥳🥳



SG Suganya Gopinath Syncfusion Team November 23, 2022 02:20 AM

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.


Loader.
Live Chat Icon For mobile
Up arrow icon