Make GroupTable computes intermediate totals


Is it possible to plan at some point to make GroupTable computes intermediate totals ? For now it displays only the grand totals in the top row.

For instance in the screenshot below, on the “client” group line, the cells for which column has an agregation could display the result of agregation for the group.



Could you please provide more information about your problem? Which version of the platform do you use? If it is possible, could you share the xml file of your screen or a small project in order to help us investigate the problem.

Have you tried updating the platform version up to 6.8? This functionality is a part of the out-of-the-box solution and this behaviour is default


Here the XML code for this table:

<groupTable id="foosTable"
                    aggregatable="true" aggregationStyle="TOP"
                <action id="create"/>
                <action id="edit"/>
                <action id="remove"/>
                <column id="name"/>
                <column id="date"/>
                <column id="price">
                    <aggregation type="SUM"/>
                <column id="count">
                    <aggregation type="SUM"/>
            <rows datasource="foosDs"/>
            <buttonsPanel id="buttonsPanel"
                <button id="createBtn"
                <button id="editBtn"
                <button id="removeBtn"

Hi Natalia,

Using 6.8.7, project in attachment reproduces the issue. The Sales group table is generated dynamically when the order line browser get refreshed.

The datasource is a CustomValueGroupDataSource generating set of KeyValueEntity on the fly.

As you can see in the screenshot below, if you group by a column, total aggregation on top is computed, but not intermediate ones.

image (107.6 KB)

1 Like


It seems that there is already issue for that Aggregation for GroupTable groups does not work if GroupTable is created programmatically · Issue #530 · cuba-platform/cuba · GitHub

Thanks Yuriy.

Seems the issue was created on 31-Aug-17, an idea when it will be fixed ?

Last months there was lot of improvements on ValueDataSource, it would be nice not to loose the momentum.



In the meantime I have found a workaround for people encountering the same issue.

Through debugging I found the grouping algorithm is split between WebAbstractTable and WebGroupTable. The first one manage an aggregationCells attribute, while the second uses a groupAggregationCells attributes.

And it seems there is some clash between the logic handling the two in the case of KeyValueEntity (I did not understand why though).

However, by extending WebGroupTable I was able to neutralise the aggregationCells property, letting the WebGroupTable uses its own one without interference.`

It fixes the issue, and it seems not having any impact on the standard case where GroupTable is used with entities that are not KeyValueEntity ones.
Here is how.

Extend WebComponentsFactory

public class ExtWebComponentsFactory extends WebComponentsFactory {

    public Component createComponent(String name) {
        if(name.equals(GroupTable.NAME)) {
            try {
                return ExtWebGroupTable.class.newInstance();
            } catch (InstantiationException | IllegalAccessException e) {
                throw new RuntimeException("Error creating the '" + name + "' component instance", e);
        return super.createComponent(name);

Override the bean in web-spring.xml

<bean id="cuba_ComponentsFactory" class=""/>

Extend WebGroupTable

public class ExtWebGroupTable<E extends Entity> extends WebGroupTable<E> {
    protected Map<Object, Object> __aggregate(AggregationContainer container, AggregationContainer.Context context) {
        this.aggregationCells = null;
        return super.__aggregate(container, context);

I’ve seen no side-effects so far.


Hello, @michael.renaud

The issue is fixed. Fixes will be available in the next release.


Great news, thanks Daniil