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?
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?
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.
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?
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.
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