Custom Aggregates shows first letter only when export excel sheet

Syncfusion Grid Version: 

"@syncfusion/ej2-angular-grids": "22.1.34"


Capture (1).png

can see the image instead of total it's showing T only and in other column it add T in front.

This is the aggregate code

aggregates: AggregateRowModel[] = [
    {
      columns: [
        {
          type: "Custom",
          field: "display_name",
          footerTemplate: "TOTAL",
        },
        {
          type: "Sum",
          field: "credit",
          format: "N",
          footerTemplate: "${Sum}",
        },
        {
          type: "Sum",
          field: "balance",
          format: "N",
          footerTemplate: "${Sum}",
        },
        {
          type: "Sum",
          field: "future",
          format: "N",
          footerTemplate: "${Sum}",
        },
        {
          type: "Sum",
          field: "used",
          format: "N",
          footerTemplate: "${Sum}",
        }
      ],
    },
  ];


In below version, it was working fine

"@syncfusion/ej2-angular-grids": "^19.3.57"



2 Replies 1 reply marked as answer

UA Usman Ali October 2, 2024 11:22 AM UTC

Hi, i just found the fix

need to use customAggregate function instead of footerTemplate

aggregates: AggregateRowModel[] = [
    {
      columns: [
        {
          type: "Custom",
          field: "display_name",
          customAggregate: () => {
return "TOTAL"
}
        },
        {
          type: "Sum",
          field: "credit",
          format: "N",
        },
        {
          type: "Sum",
          field: "balance",
          format: "N",
        },
        {
          type: "Sum",
          field: "future",
          format: "N",
          footerTemplate: "${Sum}",
        },
        {
          type: "Sum",
          field: "used",
          format: "N",
          footerTemplate: "${Sum}",
        }
      ],
    },
  ];

Marked as answer

VS Vikram Sundararajan Syncfusion Team October 3, 2024 07:18 AM UTC

Hi Usman Ali,


Greetings from Syncfusion support.


We are glad to hear that you have resolved your query on your own. Refer to our UG documentation for your reference.


UG: https://ej2.syncfusion.com/angular/documentation/grid/aggregates/custom-aggregate


Please get back to us if you have any questions.


Regards,

Vikram S


Loader.
Up arrow icon