Footer row is defined by property rDBGrid.FooterRow which can be set easily by design time editor or also by code in runtime. Open documentation page for list of FooterRow properties.
Footer row is shown automatically but calculation of summary values must be ensured in application by calling of procedure RecalculateSummaryResults. It should be called in any time when summary values can be changed:
Following properties can be also used to ensure automatic calculation:
Procedure RecalculateSummaryResults can take a long time for huge dataset with thousand of records. In this case you can use sql command to calculate result and rDBGrid event OnGetSummaryResult to define result for footer.