Dear Team,
I want accounting format at the time of excel export like (1,52,250.50).
When I will check it in excel and select the column cells then sum of cells should be look in the footer panel of excel.
I have attached the example in zip for reference.
Regards
Nagendra Gupta
Hi Nagendra,
Greetings from Syncfusion support
Based on your query we suspect that you like to format the cell value in comma separated decimal value in the Excel Export. Based on your query we have prepared a sample and we suggest you use the below way to achieve your requirement. Please refer the below sample for more information.
|
exportQueryCellInfo(args: ExcelQueryCellInfoEventArgs): void { //excelQueryCellInfo event of Grid if (args.column.field === 'Freight') { args.value = args.value.toLocaleString('en-US'); //here you can format the cell value as you want } } |
Sample: https://stackblitz.com/edit/angular-twe287?file=app.component.ts,app.component.html,data.ts
API: https://ej2.syncfusion.com/angular/documentation/api/grid/#excelquerycellinfo
Regards,
Rajapandi R
Hi Rajapandi Ravi,
Thanks for your reply.
But my requirement is not resolve yet. In your example Freight value is
showing count:2 after selection of freight column cells, these is because of NumberFormat is General
in excel.
I want sum of selected cells
in excel footer like Sum: 389,094.53. That's why my requirement is to change NumberFormat equal to Number at the time of excel export by which cells value will show as Sum in excel footer.
I am attaching zip file again for example. Please find the attach file.
Regards
Nagendra Gupta
Attachment: excelformat_b46e0a1a.zip
Hi Nagendra,
Thanks for your update
Based on your query we could see that you like to sum of selected cells in excel footer, based on your requirement we have prepared a sample and we suggest you use the below way to achieve your requirement. Please refer the below code example and sample for more information.
|
exportQueryCellInfo(args: ExcelQueryCellInfoEventArgs): void { if (args.column.field === 'Freight') { args.style = {numberFormat: '#,###.00'}; //here you can format the cell value using numberFormat property } }
|
Sample: https://stackblitz.com/edit/angular-twe287-ct7kho?file=app.component.ts,app.component.html,data.ts
Screenshot:
Regards,
Rajapandi R