KoolReport's Forum

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

Global settings for number format #1022

Open Stefan Dietl opened this topic on on Jul 31, 2019 - 2 comments

Stefan Dietl commented on Jul 31, 2019

Can I set the number format for Table columns globally - instead of setting it for each column individually. For example as a thousand separator, I basically whould like the point. Thanks Stefan

David Winterburn commented on Aug 1, 2019

Hi Stefan,

With Table or DataTables widget there's no universal way to set a metadata property across all columns but you could do that in the setup file with the Map process:

//MyReport.php
->pipe(new \koolreport\core\Map(array(
    "{meta}" => function($meta) {
        foreach ($meta["columns"] as $colName => $colMeta) {
            $meta["columns"][$colName]["thousandSeparator"] = ".";
            $meta["columns"][$colName]["decimalPoint"] = ",";
        }
        return $meta;
    }
)))
->pipe($this->dataStore("myDataStore1");

Let us know if this solves the issue for you. Thanks!

Stefan Dietl commented on Aug 1, 2019

Thank You, works great!

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