KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

Pivot: removing subtotals #134

Open bysystem opened this topic on on Oct 20, 2017 - 11 comments

bysystem commented on Oct 20, 2017

Dear support team,

in some cases it looks horrible if you have the same subtotal X times in a pivot table if you have only 1 row:

I know there is a possibility to remove the GRAND TOTAL.

But is there a way to REMOVE A SUBTOTAL ROW individually like in Excel for each column??

Could that be a FUTURE SUGGESTION?

Kind regards,

KoolReport commented on Oct 22, 2017

We will find solution for this.

dimasmaliq commented on Nov 17, 2017

hi guys, had you found a solution for these case?

bysystem commented on Dec 21, 2017

Dear Support team,

do you have in the meantime any updates for us related to the solution of the "removing subtotals" above?

dimasmaliq commented on Dec 26, 2017

up

Jure Zakrajsek commented on Jul 3, 2018

Dear Support team, Is there any solution on how to remove subtotals from the pivot table. In case of one line pivot categories it looks strange. Thx

David Winterburn commented on Jul 4, 2018

Hi,

Please download the latest version of KoolReport Pro or the Pivot package and add the following CSS rules to your page to hide subtotal rows:

<style>
    .krpmRowHeaderTotal,
    .krpmRowHeaderTotalParent,
    .krpmDataCellRowTotal {
        display: none;
    }

    .krpmRowHeaderNormalParent {
        display: table-cell;
    }

    .krpmRowHeaderTotal[data-row-field='0'],
    .krpmRow[data-row-field='0'] .krpmDataCellRowTotal {
        display: table-cell;
    }
</style>

Let us know if there's any problem with this approach. Thanks!

Jure Zakrajsek commented on Jul 5, 2018

Hi

I have pivot 4.0.0 (is there any newer version). I added the above style code to the view.php page before the pivot table, but the subtotal rows are still displayed. The style section is in the html source

https://arhiv.obscv.si/reports/meteor/index.php

Any help. Best

David Winterburn commented on Jul 6, 2018

Hi Jure,

Thanks for your feedback! It seems I confused the CSS rules for PivotMatrix and PivotTable widgets. So to hide the subtotal rows of PivotTable please use the following rules:

    .pivot-row-header-total, .pivot-data-cell-row-total {
        display: none;
    }

    .pivot-row-header-total[data-row-field='0'],
    .pivot-row-header[data-row-field='0'] ~ .pivot-data-cell-row-total {
        display: table-cell;
    }

For PivotMatrix, please use the rules of the above post. Thanks!

Jure Zakrajsek commented on Jul 6, 2018

Hi

It kind of works, but there are some gliches.

The subtotals are removed from the table, but also the grand total row is now merged accross and no values are displayed.

Also if i do a similar approach to hide the subtotal on the columns the grand total on rows dissapears and the colspans eem to be off by one column and the categories are no longer aligned correctly? <style>

.pivot-column-header-total, .pivot-data-cell-column-total {
    display: none;
}
	
.pivot-column-header-total[data-column-field='0'], 
.pivot-column-header[data-column-field='0'] ~ .pivot-data-cell-column-total {
    display: table-cell;
}	

</style>

Example: https://arhiv.obscv.si/reports/meteor/index.php

It would be nicer to have an option (like 'hideTotalRow' => true) to disable subtotal on the PivotTable object, as the styles effect al PivotTables on the report.

Thank you Jure

David Winterburn commented on Jul 9, 2018

Hi Jure,

The current released version of Pivot package hasn't supported hiding only subtotal columns yet. You can only hide all total columns including the grand total one.

We will consider adding the hideTotalRow and hideTotalColumn to future releases of the Pivot package. Thanks!

David Winterburn commented on Jul 10, 2018

Hi,

We are glad to announce that the latest development version of the Pivot package has supported hiding subtotal rows and/or columns.

If you want to try out this feature please drop us an email to support@koolphp.net. We will send you the development version via email. Thanks!

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
help needed
solved
suggestion

Pivot