Show calculation result in sfdatagrid summary row

Hi Syncfusion team,

We have the attached sfDatagrid which successfully shows a ledger statement for financial transactions. We have a column for debit, credit and balance after each individual transaction.

The first summary row shows the totals of 'Debit' and 'Credit' columns.

In the second summary record we should display the final Balance which equals the Sum(Debit) - Sum(Credit) and a word like 'Db' if total debit is greater than the total credit, or 'Cr' if vice versa.

In the attached screen shot, the second summary row should show:

Balance : 4,981.000 Db


How can we accomplish that?


Thanks and best regards,

Amr Ammar



Attachment: Ledger_statement_ca4b7a5d.rar

3 Replies 1 reply marked as answer

SD Sethupathy Devarajan Syncfusion Team July 16, 2024 03:20 PM UTC

Hi Amr,

Based on the provided information, it is clear that you need to show the balance in the second summary record which equals the Sum(Debit) - Sum(Credit) and a word like 'Db'. You can achieve this by using custom aggregate. We had shared the sample and screen shot for your reference.

 

UG Link : Custom Aggregate

 

Regards,

Sethupathy D.


Attachment: SfDataGridSample_5baa7ad1.zip

Marked as answer

AM Amr July 18, 2024 12:17 PM UTC

Hi Sethupathy,


Thank you very much for your help and support. Your sample helped me a lot to achieve my goal.


You're the best :)


Amr




SD Sethupathy Devarajan Syncfusion Team July 19, 2024 09:39 AM UTC

Hi Amr,

Thank you so much for your kind words! We are really glad to hear that the sample helped you achieve your goal. If you have any more questions or need further assistance, please don't hesitate to reach out.

Best regards,
Sethupathy D.



Loader.
Up arrow icon