Hi all,
can someone help me how to add a total sum row in the bottom of the screen?
Like what here is said. https://www.outsystems.com/forums/discussion/48405/group-totals/
And here is explained by the makers https://www.grapecity.com/wijmo/demos/Grid/Aggregation/Belowthedata/purejs
Did not exactly know how I can configure or script this
Thanks!
Hello @Wieger Kloppenburg,
Thank you for bringing this topic to the discussion.
If I understood correctly, you just want to add the aggregates below the data just like Wijmo is doing right now - here.
I attached a sample to this message. You can take a look if you want to get a better look at what I am going to explain.
To do so, you will need to specify your grid's name (whatever you want to name it):
Then, in the preparation of the Web Screen, you will need to add a new Server action - in this case, you will need to use the Javascript action:
Now it's time to prepare the method addSumRow.
You can do that by adding the method into the Javascript of the Web Screen.
Check the code below:
var addSumRow = function(gridId){ var gObj = GridOS.ComponentUtils.getGridObjectById(gridId); var grid = gObj.grid; grid.columnFooters.rows.push(new wijmo.grid.GroupRow()); grid.bottomLeftCells.setCellData(0, 0, 'S'); };
This should be enough to customize your bottom row with the aggregation values from the numeric columns.
Hi @Wieger Kloppenburg, I don't know if I understand your question, but I had to create a subtotal on my grid recently. Take a look:
I did it using a Local Variable to store the subtotal amount and a "for..each" control to iterate the aggregate (source of the grid), incrementing the values. like this:
I Hope to help you!
Hi,
What I want is like this:
The total sum row in the end of the table. So that it is still part of the table instead of another field in the page. Maybe someone will know how that can be done? And don't exactly know how I can script that. The makers of the wijmo grid give that example on their forum.
Thanks! That is what I want.
Hi Tiago,
After adding the row to aggregate the column values, how can I reference the existing cells in the new row.
The objective is, for example, to put a negative total value in red.
Thanks,
Carlos Messias