# Summary in footer

**URL:** <https://forum.servoy.com/t/summary-in-footer/8901>\
**Category:** Classic Servoy\
**Created:** [March 21, 2008, 8:36am UTC](https://forum.servoy.com/t/summary-in-footer/8901 "2008-03-21T08:36:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![martinh](https://avatars.discourse-cdn.com/v4/letter/m/848f3c/32.png) [@martinh](https://forum.servoy.com/u/martinh)\
**Post date:** [March 21, 2008, 8:36am UTC](https://forum.servoy.com/t/summary-in-footer/8901/1 "2008-03-21T08:36:25Z")

</div>

I have a form in tableview

I want to make a summary in the footer part of the form.

What is the best way (programming and performance) to create such a solution?

---

<div class="post-metadata">

**Author:** ![IT2Be](https://avatars.discourse-cdn.com/v4/letter/i/dc4da7/32.png) [@IT2Be](https://forum.servoy.com/u/IT2Be)\
**Post date:** [March 21, 2008, 9:40am UTC](https://forum.servoy.com/t/summary-in-footer/8901/2 "2008-03-21T09:40:13Z")

</div>

Depends I would say.

When the summaries are very straight forward I would use grouping and aggregations.

When not you could think of using a global variable that you fill with (html) content.

And, I am sure there are many more options but it all depends on what you need I would say.

---

<div class="post-metadata">

**Author:** ![martinh](https://avatars.discourse-cdn.com/v4/letter/m/848f3c/32.png) [@martinh](https://forum.servoy.com/u/martinh)\
**Post date:** [March 21, 2008, 9:50am UTC](https://forum.servoy.com/t/summary-in-footer/8901/3 "2008-03-21T09:50:29Z")

</div>

Now I’m using the onShow()  
I read the recordset and read all records in the recordset and make my sum, but is that the efficient way?

---

<div class="post-metadata">

**Author:** ![IT2Be](https://avatars.discourse-cdn.com/v4/letter/i/dc4da7/32.png) [@IT2Be](https://forum.servoy.com/u/IT2Be)\
**Post date:** [March 21, 2008, 10:06am UTC](https://forum.servoy.com/t/summary-in-footer/8901/4 "2008-03-21T10:06:39Z")

</div>

For that you can use grouping and aggregations.

This is described in the developer manual very well.  
I think the chapter on printing is what you need to have a look at.

---

<div class="post-metadata">

**Author:** ![martinh](https://avatars.discourse-cdn.com/v4/letter/m/848f3c/32.png) [@martinh](https://forum.servoy.com/u/martinh)\
**Post date:** [March 21, 2008, 10:39am UTC](https://forum.servoy.com/t/summary-in-footer/8901/5 "2008-03-21T10:39:50Z")

</div>

The chapter ‘printing’ is for reports  
There you have indeed the ‘Trailing Grand Summary’ part

I would expect that when I put column X in the Trailing Grand Summary part, that it would show the SUM(X), but that is not the case

And when I limit my foundset, only the total of the foundset must be shown  
And when using a foundset, then usually you don’t use a query with SUM(X)

I tried the make an aggregation in the table definition.  
I that case the aggregation, is corresponds exactly to the foundset on the screen; I can put this aggregation in the Trailing Grand Summary part.

This is a good solution, ONLY if the aggregation is only calculated when it is on a form. So when not used (specially in scripting when found/search) then it is ok; otherwise it will affect to much the performance
