KoolReport's Forum

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

Error with footer text when exporting Table to Excel #2333

Closed Javier Córdova opened this topic on on Sep 10, 2021 - 2 comments

Javier Córdova commented on Sep 10, 2021

Hi everyone, I have a question, I am using the koolreport pro 5.7.1 package and I am trying to export a table with the footer, but I am having the problem that when exporting it shows the column title instead of the corresponding sum.

Result:

Please your kind help!

Sebastian Morales commented on Sep 13, 2021

We confirm this is a bug with Excel Table's footer and will fix it in the next release of Excel package or KoolReport Pro. Meanwhile you could apply a fix with either of these methods:

1 . Use a footer "map" for the Excel Table:

\koolreport\excel\Table::create(array(
    ...
    "columns" => array(...),
    "map" => array(
        ...
        "footer" => function($colName, $footerValue) { return $footerValue; },
    )
));

2 . Open the file koolreport/excel/TableBuilder.php and replace this line:

    $value = Util::map($map, $args, $label);

with this one:

    $value = Util::map($map, $args, empty($footerValue) ? $label : $footerValue);

Let us know if these works for you or not. Tks,

Javier Córdova commented on Sep 28, 2021

Thank you Sebastián for your response, I have solved it using "map" thank you very much.

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

Excel