KoolReport's Forum

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

Number_format() error when reading varchar from postgres #2635

Open pooja dhotre opened this topic on on Apr 7, 2022 - 11 comments

pooja dhotre commented on Apr 7, 2022

I have a column of type varchar in postgres DB, getting below error when trying to display data from postgres.

"Warning: number_format() expects parameter 1 to be float, string given in C:\php workspace\koolreport-5.5.0\koolreport\core\src\core\Utility.php on line 149"

I'm using PostgreSQLDataSource to connect to DB

Can anyone please help me?

Sebastian Morales commented on Apr 8, 2022

Pls change the column's meta type to string like this:

$this->src("pgsql")
->query(...)
->pipe(new \koolreport\processes\ColumnMeta([
    "column_1" => [ //change "column_1" to your varchar column name
        "type" => "string",
    ]
]))
->pipe(...)
pooja dhotre commented on Apr 8, 2022

Thank you Sebastian, that worked. I have below code in my view file, but still my report is not showing any table format to it. <?php

use \koolreport\widgets\koolphp\Table;

?> <meta charset="UTF-8"> <div class="report-content">

<div>
    <?php
    Table::create(array(
        "dataSource" => $this->dataStore('asop_data'),
    ));
    ?>
</div>

</div>

Sebastian Morales commented on Apr 8, 2022

Do you use Bootstrap 3 or 4 in your project?

pooja dhotre commented on Apr 8, 2022

no

Sebastian Morales commented on Apr 8, 2022

You can add Bootstrap CSS link directly to your report or use the Bootstrap trait provided by KoolReport like this:

class MyReport extends koolreport\KoolReport
{
    use koolreport\clients\Bootstrap; // load Bootstrap 3
    
    ...
}
pooja dhotre commented on Apr 8, 2022

I'm new to koolreport, using Table widget will not provide table structure on UI?

Sebastian Morales commented on Apr 8, 2022

Table widget renders datastore to table html format but it would not be looking good without a CSS theme like Bootstrap or others. Pls provide a screenshot if you have a table html problem.

pooja dhotre commented on Apr 8, 2022

Do we need to buy Excel package to create Excel export POC for my project?

Sebastian Morales commented on Apr 12, 2022

Yes, you would need to. The Excel package provides datasources, export ability for Excel, ODS, CSV formats. Rgds,

pooja dhotre commented on Apr 13, 2022

To build a Pie Chart report?...we need to buy chartJS package right?

Sebastian Morales commented on Apr 14, 2022

For Pie chart and other types of charts you could use Google Charts (free, included in the Core framework), Chartjs, D3, or Morris chart (Donut instead of Pie) packages. The latter three would need to be bought.

https://www.koolreport.com/examples/reports/google_charts/pie_chart/

https://www.koolreport.com/examples/reports/chartjs/pie_chart/

https://www.koolreport.com/examples/reports/d3/pie_chart/

https://www.koolreport.com/examples/reports/morris_chart/donut/

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