KoolReport's Forum

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

Footer with own formula #1554

Open stacy opened this topic on on Aug 6, 2020 - 2 comments

stacy commented on Aug 6, 2020

Hi, Is there a way to have my own formula for the footer ? Lets say I have column : Start, End, Change I need to footer for the Column end to show sum(Start)/sum(End)*100 .

Please advise, thank you.

Regards Lee

stacy commented on Aug 6, 2020

I manage to it for Tables, but I need to do for DataTables. If this is not possible, is that a way to freeze the order/sort for last column?

David Winterburn commented on Aug 7, 2020

Hi Stacy,

I guess we could try the footerCallBack option of DataTables:

https://datatables.net/examples/advanced_init/footer_callback.html

To use this with KoolReport's DataTables widget please try this call:

    \koolreport\datagrid\DataTables::create(array(
        ...
        "options" => array(
            "footerCallback" => "function ( rows, group ) {
                //calculate sum(start), sum(end) here and put sum(start)/sum(end) at end column index footer
            ",
        ),
    ));

Let us know if you have any difficulty apply this. 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
None yet

None