KoolReport's Forum

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

How to remove special character from table value #845

Open Keerthiga opened this topic on on May 2, 2019 - 1 comments

Keerthiga commented on May 2, 2019

Hi team, I have to remove /(slash) from my table value it fetch from database. for exacmple ,If i have value like JOB34/65748-1 . Now, I need to shown like JOB34 65748-1 in my table data. Please , advice how to remove or format special characters in koolreport table view.

David Winterburn commented on May 2, 2019

Hi Keerthiga,

With both our Table and DataTables widgets, there's the "formatValue" property for each column where you could customize a column's display value. For example:

Table::create(array(
        "dataStore"=>$this->dataStore("data_sample"),
        "columns"=>array(
            "item",
            "total"=>array(
                "formatValue"=>function($value, $row)
                {
                    return (($value>1000)?"<i class='fa fa-thumbs-o-up text-success'></i>":"<i class='fa fa-thumbs-o-down text-danger'></i>").' $'.number_format($value);
                }
            )
        )
    ));

Just change the formatValue's function to modify your returned value. Let us know if this helps solve your problem. 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
help needed

None