KoolReport's Forum

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

Excel Table #1389

Open sevgi opened this topic on on Apr 15, 2020 - 1 comments

sevgi commented on Apr 15, 2020

excel\Table - json doesn't transmit data "column" => array( 'HES' =>array(

                "formatValue"=>function($value,$row){
                    $json_data=$value;
                    $drives = json_decode($json_data,true);
                    return $drives["HIZMET"]["priority"].' - '.$drives["HIZMET"]['he'];

                }
            ),

),

json data not decode

David Winterburn commented on Apr 16, 2020

Hi Sevgi,

The excel/Table widget hasn't had "formatValue" feature yet, unlike the core/Table html widget. While waiting for this feature you could work around it by using the Map process in the report's setup to transform the JSON column into other columns like this:

//MyReport.php
    ...
    ->pipe(new \koolreport\processes\Map(array(
        "{value}" => function($row) {
            $json_data = $row["jsonColumn"];
            $drives = json_decode($json_data, true);
            $row["newColumn"] = $drives["HIZMET"]["priority"].' - '.$drives["HIZMET"]['he'];
            return $row;
        }
    )))
    ->pipe($this->dataStore("excelDataStore"));

Let us know if you have difficulty getting result from this method. 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