KoolReport's Forum

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

How to add subtotal amount in rowgroup collapse #3063

Open Komuraiah A opened this topic on on Jun 1, 2023 - 1 comments

Komuraiah A commented on Jun 1, 2023

Hi team, am creating a report based on rowgroup collapse. in here report showing corrctly, but when try to add total sum amount it is not working can you explain how to add total sum in category type. below here am sharing screenshot

in here am trying to add dollar sales sum total based on category type

Sebastian Morales commented on Jun 5, 2023

Pls check this example of ours which is similar to your request:

https://www.koolreport.com/examples/reports/datagrid/rowgroup/

Here's the code for it:

        "clientRowGroup" => [
            ...
            "productLine" => [
                'direction' => 'desc',
                'calculate' => [
                    'totalSales' => [
                        'sum', 'dollar_sales'
                    ],
                "top" => "<td colspan='999'>{expandCollapseIcon} Top: Line: {productLine} | Total: {totalSales}</td>",
            ],
        ], 

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

None