377
Views
11
Comments
Solved
[OutSystems Data Grid] Possible to show aggregation in a total row?
outsystems-data-grid
Reactive icon
Forge asset by OutSystems
Application Type
Reactive

Hi


We are looking for the possibitity to add a total row (without grouping), like in this example: https://www.grapecity.com/wijmo/demos/Grid/Aggregation/Belowthedata/purejs

Is this possible to do, or can we raise this as a feature request?

It would be a great functionality.

Regards,

Bård

2019-06-24 10-44-54
Daniel Figueira
Solution

Hi,

Sorry, I forgot to include that part.
Use:

gridObj .getColumns().forEach(function(column){

if(column.columnType == 'Number'){

column.provider.aggregate = 'Sum';}

});

In the IF condition you can use whatever you want. In this case, I'm showing the totals for all Number Columns but you can do it by binding for example-  column.provider.binding == 'Customer.Age'.

Best Regards,
Daniel Figueira

UserImage.jpg
Bård Indredavik

Thank you, work very good!

2023-10-26 08-43-17
Samy Sah


Could you share the sample oml file please? 

2019-06-24 10-44-54
Daniel Figueira
Solution

Hi,

While we don't have this option in the grid, you can achieve it by putting the following JS in the GridOnInitialize Event:

var gridObj = GridAPI.GridManager.GetGridById($parameters.WidgetId);

gridObj.provider.columnFooters.rows.push(new wijmo.grid.GroupRow());

gridObj.provider.bottomLeftCells.setCellData(0, 0, 'Σ');

Best Regards,

Daniel Figueira







2022-09-16 08-04-04
Bruno Martinho
Staff

Thanks @Daniel Figueira ,

That is the code behind that we are pursuing. Of course, our goal is to make it low code so every developer can use it.

Thanks,

Bruno Martinho


UserImage.jpg
Bård Indredavik

Thank you Daniel. I get the totalrow drawn as wanted with this approach, without values.  How can I tell it to for example sum a specific number column?

2022-11-12 11-28-30
Gonçalo Martins
Staff
Solution

Hi @sanjay kumar 

You can see this on the OutSystems Data Grid Sample on this page.

2020-08-05 08-52-58
Ruben Goncalves

Hi Bård,

Thank you for being such an active user of the grid! Many of your questions and requests have greatly helped us to add and prioritize features in our backlog!

This being said, thank you for bringing this to discussion - we've added this to our backlog, and did some preliminary tests (the results look promising)!

We'll keep you posted on the decision to add this feature or (at least) to provide a reasonable workaround to achieve it.

Cheers,
RG

2019-06-24 10-44-54
Daniel Figueira
Solution

Hi,

While we don't have this option in the grid, you can achieve it by putting the following JS in the GridOnInitialize Event:

var gridObj = GridAPI.GridManager.GetGridById($parameters.WidgetId);

gridObj.provider.columnFooters.rows.push(new wijmo.grid.GroupRow());

gridObj.provider.bottomLeftCells.setCellData(0, 0, 'Σ');

Best Regards,

Daniel Figueira







2022-09-16 08-04-04
Bruno Martinho
Staff

Thanks @Daniel Figueira ,

That is the code behind that we are pursuing. Of course, our goal is to make it low code so every developer can use it.

Thanks,

Bruno Martinho


UserImage.jpg
Bård Indredavik

Thank you Daniel. I get the totalrow drawn as wanted with this approach, without values.  How can I tell it to for example sum a specific number column?

2019-06-24 10-44-54
Daniel Figueira
Solution

Hi,

Sorry, I forgot to include that part.
Use:

gridObj .getColumns().forEach(function(column){

if(column.columnType == 'Number'){

column.provider.aggregate = 'Sum';}

});

In the IF condition you can use whatever you want. In this case, I'm showing the totals for all Number Columns but you can do it by binding for example-  column.provider.binding == 'Customer.Age'.

Best Regards,
Daniel Figueira

UserImage.jpg
Bård Indredavik

Thank you, work very good!

2023-10-26 08-43-17
Samy Sah


Could you share the sample oml file please? 

UserImage.jpg
sanjay kumar

Hi Daniel Figueira,

Could you share the sample oml file for the same.

2022-11-12 11-28-30
Gonçalo Martins
Staff
Solution

Hi @sanjay kumar 

You can see this on the OutSystems Data Grid Sample on this page.

UserImage.jpg
Jesus Reategui Morales
Staff

To the people asking for this:

Outsystems implemented this functionality with the SetColumnAggregate client action.

You just need to:

  1. Set the Grid OptionalConfigs.ShowAggregateValues parameter to True. 
  2. in the method: OnInitialize of the grid, you need to call the SetColumnAggegate client method, specifying the column and aggregate (SUM, AVG, ETC).

More details Component docuumentation

Special thanks to @Gonçalo Martins who add the link of the documentation!!!!



Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.