KoolReport's Forum

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

Multiple rows of data on table's footer #91

Open tee opened this topic on on Aug 25, 2017 - 8 comments

tee commented on Aug 25, 2017

Hi support team,

Is it possible to have multiple rows of data on table's footer? What i know up to now is "footer"=>"sum" and "footerText"=>$variable. Let say i want my table's footer to display both. Can? Appreciate you.

KoolReport commented on Aug 25, 2017

Yes, it is possible. The footerText is just a template where you can insert the sum, you can do:

"footer"=>"sum",
"footerText"=>"The sum is @value"

As a result you will see "The sum is $40".

You can put HTML to the footerText as well so that it can display in multiple lines that you want.

tee commented on Aug 25, 2017

I tried what you have guided me, but i only got one line of result (Outlet : US) instead of two lines of result on table's footer. Where is my mistake? Thanks.

        $outlet = $this->dataStore("report1")->data()[0]["outlet"];
        Table::create(array(
        "dataStore"=>$this->dataStore('report1'),
        "showFooter"=>"top",
        "columns"=>array(
            "qty_pos"=>array(
                "footer"=>"sum",
                "footerText"=>"Outlet : $outlet",
            )
        )));
KoolReport commented on Aug 25, 2017

You do:

            "qty_pos"=>array(
                "footer"=>"sum",
                "footerText"=>"@value <br/> Outlet : $outlet",
            )
Kay commented on Jun 16, 2021

Can I have a footer with 2 or 3 rows?

KoolReport commented on Jun 16, 2021

That's sad that our Table has only 1 footer. If you want a custom table, you can build yourself, use our datastore as source of data, constructing the header, make a loop for data rows and make as many footer as you want and fill those footer with data.

Sebastian Morales commented on Jun 16, 2021

There's a possibility to construct custom footer with datagrid/DataTables widget. Would you pls give us a specific example with multiple rows for footer? Rgds,

Kay commented on Jun 17, 2021

So basically I have a datastore and using filter I'm getting different total values for each column. I want these totals to be in different rows. Also I am using Table widget. Thanks

Sebastian Morales commented on Jun 21, 2021

It's complicated to set up a real to set up real multi rows for table footer but I think you could simulate it using <span>, <br> and some borders. For example:

            "labelColumn"=>array(
                "footerText"=>"<span style='border-bottom:1px solid'>Total #1</span><br><span 'border-bottom:1px solid'>Total #2</span>",
            ),
            "numericColumn"=>array(
                "footerText"=>"<span style='border-bottom:1px solid'>{sum1}</span><br><span 'border-bottom:1px solid'>{sum2}</span>",
            )

Let us know if this works for you. Tks,

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