KoolReport's Forum

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

Object of class could be converted to string #2316

Closed Niall McGuirk opened this topic on on Sep 2, 2021 - 11 comments

Niall McGuirk commented on Sep 2, 2021

I've got an error and I'm not sure what's causing it, as it doesn't say where in my php file its occurring. Just that its occurring in the PDoDataSource file. The datasource in config.php is correct with the one in the MyReport.php. Could you tell me what is causing the errors?

Recoverable fatal error: Object of class koolreport\datasources\PdoDataSource could not be converted to string in C:\Apache24\htdocs\koolreport\core\src\datasources\PdoDataSource.php on line 287

This is the error I'm getting

Here is another error which may be related to the first.

Here is MyReport.php code

<?php
//Step 1: Load KoolReport
require_once "../../load.koolreport.php";

//Step 2: Creating Report class
class MyReport extends \koolreport\KoolReport
{
    use \koolreport\inputs\Bindable;
    use \koolreport\inputs\POSTBinding;

    protected function defaultParamValues()
    {
        return array(
            //"activeperiod"=>array("2107"),
            //"compareperiod"=>array("2106"),
            "activeperiod"=>array($this->src("kazzicom_kpi")->query("
                            select Distinct YearMonth
                            from tbl_KPIMetrics
                            Order by YearMonth Desc Limit 0,1")),
            "compareperiod"=>array($this->src("kazzicom_kpi")->query("
                            select Distinct YearMonth
                            from tbl_KPIMetrics
                            Order by YearMonth Desc Limit 1,1")),
        );
    }
    
    protected function bindParamsToInputs()
    {
        return array(
            "activeperiod",
            "compareperiod",
        );
    }

    protected function settings()
    {
        $config = include "../../config.php";
        return array(
            "dataSources"=>$config
        );
    }

    protected function setup()
    {
        
 
    }
}

Here is my View.Myreport.php

<?php
    use \koolreport\widgets\koolphp\Card;
    use \koolreport\inputs\Select2;
?>
<div class="report-content">
    <div class="text-center">
        <h1>KPI Summary</h1>
        <p class="lead">
            Shows the Sales KPIs for this month.
        </p>
    </div>

    <form method="post">
        <div class="row">
            <div class="col-md-6">
                <div class="form-group">
                    <b>Active Period</b>
                    <?php 
                    Select2::create(array(
                        "multiple"=>false,
                        "name"=>"activeperiod",
                        "dataSource"=>$this->src("kazzicom_kpi")->query("
                            select Distinct YearMonth
                            from tbl_kpimetrics
                            Order by YearMonth Desc
                        "),
                        "attributes"=>array(
                            "class"=>"form-control"
                        )
                    ));
                    ?>
                </div>    
  
            </div>
            <div class="col-md-6">
                <div class="form-group">
                    <b>Compare To Period</b>
                    <?php 
                    Select2::create(array(
                        "multiple"=>false,
                        "name"=>"compareperiod",
                        "dataSource"=>$this->src("kazzicom_kpi")->query("
                            select Distinct YearMonth
                            from tbl_KPIMetrics 
                            Order by YearMonth Desc Limit 1,100
                        "),
                        "attributes"=>array(
                            "class"=>"form-control"
                        )
                    ));
                    ?>
                </div>    
  
                <div class="form-group">
                    <button class="btn btn-primary">Submit</button>
                </div>    
            </div>
        </div>
        
    </form>

    <div class="row">
        <div class="col-md-3">
            <?php
            Card::create(array(
                "value"=>$this->src("kazzicom_kpi")->query("SELECT MetricValue FROM tbl_KPIMetrics where Client='Kazzicom' and YearMonth= :activeperiod and MetricID=1")->params(array(
                ":activeperiod"=>$this->params["activeperiod"],
                )),
                "baseValue"=>$this->src("kazzicom_kpi")->query("SELECT MetricValue FROM tbl_KPIMetrics where Client='Kazzicom' and YearMonth= :compareperiod and MetricID=1")->params(array(
                ":compareperiod"=>$this->params["compareperiod"],
                )),
                "title"=>"Clients Acquired",
                "cssClass"=>array(
                    "card"=>"bg-info",
                    "title"=>"text-white",
                    "value"=>"text-white"
                )
            ));
            ?>
        </div>
        <div class="col-md-3">
            <?php
            Card::create(array(
                "value"=>$this->src("kazzicom_kpi")->query("SELECT MetricValue FROM tbl_KPIMetrics where Client='Kazzicom' and YearMonth= :activeperiod and MetricID=2")->params(array(
                ":activeperiod"=>$this->params["activeperiod"],
                )),
                "baseValue"=>$this->src("kazzicom_kpi")->query("SELECT MetricValue FROM tbl_KPIMetrics where Client='Kazzicom' and YearMonth= :compareperiod and MetricID=2")->params(array(
                ":compareperiod"=>$this->params["compareperiod"],
                )),
                "title"=>"Sales Pipeline",
                "cssClass"=>array(
                    "card"=>"bg-warning",
                    "title"=>"text-white",
                    "value"=>"text-white"
                )
            ));
            ?>
        </div>
        <div class="col-md-3">
            <?php
            Card::create(array(
                "value"=>$this->src("kazzicom_kpi")->query("SELECT MetricValue FROM tbl_KPIMetrics where Client='Kazzicom' and YearMonth= :activeperiod and MetricID=3")->params(array(
                ":activeperiod"=>$this->params["activeperiod"],
                )),
                "baseValue"=>$this->src("kazzicom_kpi")->query("SELECT MetricValue FROM tbl_KPIMetrics where Client='Kazzicom' and YearMonth= :compareperiod and MetricID=3")->params(array(
                ":compareperiod"=>$this->params["compareperiod"],
                )),
                "title"=>"Emails Sent",
                "format"=>array(
                    "value"=>array(
                        "prefix"=>""
                    )
                ),
                "cssClass"=>array(
                    "card"=>"bg-success",
                    "title"=>"text-white",
                    "value"=>"text-white"
                )
            ));
            ?>
        </div>

        <div class="col-md-3">
            <?php
            Card::create(array(
                "value"=>$this->src("kazzicom_kpi")->query("SELECT MetricValue FROM tbl_KPIMetrics where Client='Kazzicom' and YearMonth= :activeperiod and MetricID=4")->params(array(
                ":activeperiod"=>$this->params["activeperiod"],
                )),
                "baseValue"=>$this->src("kazzicom_kpi")->query("SELECT MetricValue FROM tbl_KPIMetrics where Client='Kazzicom' and YearMonth= :compareperiod and MetricID=4")->params(array(
                ":compareperiod"=>$this->params["compareperiod"],
                )),
                "title"=>"Client Calls",
                "format"=>array(
                    "value"=>array(
                        "prefix"=>""
                    )
                ),
                "cssClass"=>array(
                    "card"=>"bg-dark",
                    "title"=>"text-white",
                    "value"=>"text-white"
                )
            ));
            ?>
        </div>
    </div>

    <div class="text-center" style="margin-top:30px;">
        <h3>Brand Summary</h3>
        <p class="lead">
            Shows the Brand KPIs for this month.
        </p>
    </div>

    <div class="row">
        <div class="col-md-3">
        <?php
        Card::create(array(
            "value"=>$this->src("kazzicom_kpi")->query("SELECT MetricValue FROM tbl_KPIMetrics where Client='Kazzicom' and YearMonth= :activeperiod and MetricID=5")->params(array(
                ":activeperiod"=>$this->params["activeperiod"],
                )),
            "baseValue"=>$this->src("kazzicom_kpi")->query("SELECT MetricValue FROM tbl_KPIMetrics where Client='Kazzicom' and YearMonth= :compareperiod and MetricID=5")->params(array(
                ":compareperiod"=>$this->params["compareperiod"],
                )),
            "format"=>array(
                "value"=>array(
                    "prefix"=>""
                )
            ),
            "title"=>"Website Visitors",
            "cssClass"=>array(
                    "card"=>"bg-info",
                    "title"=>"text-white",
                    "value"=>"text-white"
                )
        ));
        ?>    
        </div>
        <div class="col-md-3">
        <?php
        Card::create(array(
            "value"=>$this->src("kazzicom_kpi")->query("SELECT MetricValue FROM tbl_KPIMetrics where Client='Kazzicom' and YearMonth= :activeperiod and MetricID=6")->params(array(
                ":activeperiod"=>$this->params["activeperiod"],
                )),
            "baseValue"=>$this->src("kazzicom_kpi")->query("SELECT MetricValue FROM tbl_KPIMetrics where Client='Kazzicom' and YearMonth= :compareperiod and MetricID=6")->params(array(
                ":compareperiod"=>$this->params["compareperiod"],
                )),
            "format"=>array(
                "value"=>array(
                    "suffix"=>""
                )
            ),
            "title"=>"Impressions",
            "cssClass"=>array(
                    "card"=>"bg-warning",
                    "title"=>"text-white",
                    "value"=>"text-white"
                )
        ));
        ?>
        </div>        
        <div class="col-md-3">
        <?php
        Card::create(array(
            "value"=>$this->src("kazzicom_kpi")->query("SELECT MetricValue FROM tbl_KPIMetrics where Client='Kazzicom' and YearMonth= :activeperiod and MetricID=7")->params(array(
                ":activeperiod"=>$this->params["activeperiod"],
                )),
            "baseValue"=>$this->src("kazzicom_kpi")->query("SELECT MetricValue FROM tbl_KPIMetrics where Client='Kazzicom' and YearMonth= :compareperiod and MetricID=7")->params(array(
                ":compareperiod"=>$this->params["compareperiod"],
                )),
            "format"=>array(
                "value"=>array(
                    "suffix"=>""
                )
            ),
            "title"=>"Engagements",
            "cssClass"=>array(
                    "card"=>"bg-success",
                    "title"=>"text-white",
                    "value"=>"text-white"
                )
        ));
        ?>
        </div>        
        <div class="col-md-3">
        <?php
        Card::create(array(
            "value"=>$this->src("kazzicom_kpi")->query("SELECT MetricValue FROM tbl_KPIMetrics where Client='Kazzicom' and YearMonth= :activeperiod and MetricID=8")->params(array(
                ":activeperiod"=>$this->params["activeperiod"],
                )),
            "baseValue"=>$this->src("kazzicom_kpi")->query("SELECT MetricValue FROM tbl_KPIMetrics where Client='Kazzicom' and YearMonth= :compareperiod and MetricID=8")->params(array(
                ":compareperiod"=>$this->params["compareperiod"],
                )),
            "format"=>array(
                "value"=>array(
                    "suffix"=>""
                )
            ),
            "title"=>"Followers",
            "cssClass"=>array(
                    "card"=>"bg-dark",
                    "title"=>"text-white",
                    "value"=>"text-white"
                )
        ));
        ?>
        </div>        
    </div>

    <div class="text-center" style="margin-top:30px;">
        <h3>Support Summary</h3>
        <p class="lead">
            Shows the Support KPIs for this month.
        </p>
    </div>

    <div class="row">
        <div class="col-md-3">
        <?php
        Card::create(array(
            "value"=>$this->src("kazzicom_kpi")->query("SELECT MetricValue FROM tbl_KPIMetrics where Client='Kazzicom' and YearMonth= :activeperiod and MetricID=9")->params(array(
                ":activeperiod"=>$this->params["activeperiod"],
                )),
            "baseValue"=>$this->src("kazzicom_kpi")->query("SELECT MetricValue FROM tbl_KPIMetrics where Client='Kazzicom' and YearMonth= :compareperiod and MetricID=9")->params(array(
                ":compareperiod"=>$this->params["compareperiod"],
                )),
            "format"=>array(
                "value"=>array(
                    "prefix"=>""
                )
            ),
            "title"=>"Incoming Tickets",
            "cssClass"=>array(
                    "card"=>"bg-info",
                    "title"=>"text-white",
                    "value"=>"text-white"
                )
        ));
        ?>    
        </div>
        <div class="col-md-3">
        <?php
        Card::create(array(
            "value"=>$this->src("kazzicom_kpi")->query("SELECT MetricValue FROM tbl_KPIMetrics where Client='Kazzicom' and YearMonth= :activeperiod and MetricID=10")->params(array(
                ":activeperiod"=>$this->params["activeperiod"],
                )),
            "baseValue"=>$this->src("kazzicom_kpi")->query("SELECT MetricValue FROM tbl_KPIMetrics where Client='Kazzicom' and YearMonth= :compareperiod and MetricID=10")->params(array(
                ":compareperiod"=>$this->params["compareperiod"],
                )),
            "format"=>array(
                "value"=>array(
                    "suffix"=>""
                )
            ),
            "title"=>"Resolved Tickets",
            "cssClass"=>array(
                    "card"=>"bg-warning",
                    "title"=>"text-white",
                    "value"=>"text-white"
                )
        ));
        ?>
        </div>        
        <div class="col-md-3">
        <?php
        Card::create(array(
            "value"=>$this->src("kazzicom_kpi")->query("SELECT MetricValue FROM tbl_KPIMetrics where Client='Kazzicom' and YearMonth= :activeperiod and MetricID=11")->params(array(
                ":activeperiod"=>$this->params["activeperiod"],
                )),
            "baseValue"=>$this->src("kazzicom_kpi")->query("SELECT MetricValue FROM tbl_KPIMetrics where Client='Kazzicom' and YearMonth= :compareperiod and MetricID=11")->params(array(
                ":compareperiod"=>$this->params["compareperiod"],
                )),
            "format"=>array(
                "value"=>array(
                    "suffix"=>""
                )
            ),
            "title"=>"Reopened Tickets",
            "cssClass"=>array(
                    "card"=>"bg-success",
                    "title"=>"text-white",
                    "value"=>"text-white"
                )
        ));
        ?>
        </div>        
        <div class="col-md-3">
        <?php
        Card::create(array(
            "value"=>$this->src("kazzicom_kpi")->query("SELECT MetricValue FROM tbl_KPIMetrics where Client='Kazzicom' and YearMonth= :activeperiod and MetricID=12")->params(array(
                ":activeperiod"=>$this->params["activeperiod"],
                )),
            "baseValue"=>$this->src("kazzicom_kpi")->query("SELECT MetricValue FROM tbl_KPIMetrics where Client='Kazzicom' and YearMonth= :compareperiod and MetricID=12")->params(array(
                ":compareperiod"=>$this->params["compareperiod"],
                )),
            "format"=>array(
                "value"=>array(
                    "suffix"=>""
                )
            ),
            "title"=>"Avg Resp Time (hrs)",
            "cssStyle"=>array(
                "negative"=>"color:#3c763d",
                "positive"=>"color:#a94442",
            ),
            "cssClass"=>array(
                    "card"=>"bg-dark",
                    "title"=>"text-white",
                    "value"=>"text-white"
                )
        ));
        ?>
        </div>        
    </div>

    <div class="text-center" style="margin-top:30px;">
        <h3>Testing / Quality Assurance Summary</h3>
        <p class="lead">
            Shows the Testing/QA KPIs for this month.
        </p>
    </div>

    <div class="row">
        <div class="col-md-3">
        <?php
        Card::create(array(
            "value"=>$this->src("kazzicom_kpi")->query("SELECT MetricValue FROM tbl_KPIMetrics where Client='Kazzicom' and YearMonth= :activeperiod and MetricID=13")->params(array(
                ":activeperiod"=>$this->params["activeperiod"],
                )),
            "baseValue"=>$this->src("kazzicom_kpi")->query("SELECT MetricValue FROM tbl_KPIMetrics where Client='Kazzicom' and YearMonth= :compareperiod and MetricID=13")->params(array(
                ":compareperiod"=>$this->params["compareperiod"],
                )),
            "format"=>array(
                "value"=>array(
                    "prefix"=>""
                )
            ),
            "title"=>"New Defects",
            "cssClass"=>array(
                    "card"=>"bg-info",
                    "title"=>"text-white",
                    "value"=>"text-white"
                )
        ));
        ?>    
        </div>
        <div class="col-md-3">
        <?php
        Card::create(array(
            "value"=>$this->src("kazzicom_kpi")->query("SELECT MetricValue FROM tbl_KPIMetrics where Client='Kazzicom' and YearMonth= :activeperiod and MetricID=14")->params(array(
                ":activeperiod"=>$this->params["activeperiod"],
                )),
            "baseValue"=>$this->src("kazzicom_kpi")->query("SELECT MetricValue FROM tbl_KPIMetrics where Client='Kazzicom' and YearMonth= :compareperiod and MetricID=14")->params(array(
                ":compareperiod"=>$this->params["compareperiod"],
                )),
            "format"=>array(
                "value"=>array(
                    "suffix"=>""
                )
            ),
            "title"=>"Closed Issues",
            "cssClass"=>array(
                    "card"=>"bg-warning",
                    "title"=>"text-white",
                    "value"=>"text-white"
                )
        ));
        ?>
        </div>        
        <div class="col-md-3">
        <?php
        Card::create(array(
            "value"=>$this->src("kazzicom_kpi")->query("SELECT MetricValue FROM tbl_KPIMetrics where Client='Kazzicom' and YearMonth= :activeperiod and MetricID=15")->params(array(
                ":activeperiod"=>$this->params["activeperiod"],
                )),
            "baseValue"=>$this->src("kazzicom_kpi")->query("SELECT MetricValue FROM tbl_KPIMetrics where Client='Kazzicom' and YearMonth= :compareperiod and MetricID=15")->params(array(
                ":compareperiod"=>$this->params["compareperiod"],
                )),
            "format"=>array(
                "value"=>array(
                    "suffix"=>""
                )
            ),
            "title"=>"Open",
            "cssClass"=>array(
                    "card"=>"bg-success",
                    "title"=>"text-white",
                    "value"=>"text-white"
                )
        ));
        ?>
        </div>        
        <div class="col-md-3">
        <?php
        Card::create(array(
            "value"=>$this->src("kazzicom_kpi")->query("SELECT MetricValue FROM tbl_KPIMetrics where Client='Kazzicom' and YearMonth= :activeperiod and MetricID=16")->params(array(
                ":activeperiod"=>$this->params["activeperiod"],
                )),
            "baseValue"=>$this->src("kazzicom_kpi")->query("SELECT MetricValue FROM tbl_KPIMetrics where Client='Kazzicom' and YearMonth= :compareperiod and MetricID=16")->params(array(
                ":compareperiod"=>$this->params["compareperiod"],
                )),
            "format"=>array(
                "value"=>array(
                    "suffix"=>""
                )
            ),
            "title"=>"Avg Resp Time (days)",
            "cssClass"=>array(
                    "card"=>"bg-dark",
                    "title"=>"text-white",
                    "value"=>"text-white"
                )
        ));
        ?>
        </div>        
    </div>

</div>
KoolReport commented on Sep 2, 2021

This part is wrong, you assign class object to value which should be string. We can not assign object to value of Select2

            "activeperiod"=>array($this->src("kazzicom_kpi")->query("
                            select Distinct YearMonth
                            from tbl_KPIMetrics
                            Order by YearMonth Desc Limit 0,1")),
            "compareperiod"=>array($this->src("kazzicom_kpi")->query("
                            select Distinct YearMonth
                            from tbl_KPIMetrics
                            Order by YearMonth Desc Limit 1,1")),
Niall McGuirk commented on Sep 3, 2021

I'm not sure I fully understand. Is the "activeperiod" and "compareperiod" a key the the assoc array containing the sql query? How should it be if not a string?

Is it possible to use php ($activeperiod) variables in the sql statement somehow? I've tried it before, but it didn't work just inserting $activeperiod into the sql query and declaring it where I have the "activeperiod" & "compareperiod" strings atm.

How do I make it so I can use the activeperiod and compareperiod as a variable within the sql statement on Myreport.view.php.

Niall McGuirk commented on Sep 3, 2021

Where in the code above was an object being assigned to Select2? What object was being assigned?

Sorry for the confusion, I'm fairly new to Kool Reports

KoolReport commented on Sep 3, 2021

Hi,

The function src() will return DataSource object, in your example you use:

$this->src("kazzicom_kpi")->query("
                            select Distinct YearMonth
                            from tbl_KPIMetrics
                            Order by YearMonth Desc Limit 0,1")

Above will return an object, not string. The value of Select2 multiple selection should be array of string

I think I know what you are trying to do, you want to preset the default for activeperiod and comareperiod with value from query

You need to do this:

protected function defaultParamValues()
{
    $periodStore = $this->src("kazzicom_kpi")->query("
        select Distinct YearMonth
        from tbl_KPIMetrics
        Order by YearMonth Desc Limit 2
    ")
    ->pipe(new \koolreport\core\DataStore)
    ->requestDataSending(); //Force to perform query data

    return array(
        "activeperiod"=>array($periodStore->get(0,"YearMonth")),
        "compareperiod"=>array($periodStore->get(1,"YearMonth")),
    );
}
Niall McGuirk commented on Sep 3, 2021

Thanks. I've replaced the defaultParamValues() function with your suggested code. That resolved the error, it now actually shows some cards. However, it still has the same error but converting to numbers instead of a string.

And also doesn't load the Inputs. They've got an Array to String conversion notice, when they should be loading the date options

The Inputs should look something like this:

Niall McGuirk commented on Sep 3, 2021

I'm still not sure where the object is being used in place of strings or numbers. It was attempting to use an associative array, and still is in your code. What is causing the object conversion in the code?

Niall McGuirk commented on Sep 3, 2021

I might know what the problem is. This is the form input for activePeriod. Is the problem that the Select2 input box is named activeperiod. The initial assoc Array in the defaultParamValues() function is also activeperiod (and the same for compareperiod) Could there be a mixing of variables?

<form method="post">
        <div class="row">
            <div class="col-md-6">
                <div class="form-group">
                    <b>Active Period</b>
                    <?php 
                    //LISTS MONTHYEARS FROM METRICS TABLE
                    Select2::create(array(
                        "multiple"=>false,
                        "name"=>"activeperiod",
                        "dataSource"=>$this->src("kazzicom_kpi")->query("
                            select Distinct YearMonth
                            from tbl_kpimetrics
                            Order by YearMonth Desc
                        "),
                        "attributes"=>array(
                            "class"=>"form-control"
                        )
                    ));
                    ?>

So when it activeperiod is used in the Card value, is this trying to use the Select2 activeperiod input box as the Card value? If so, how do you have a separate variable, or get the $_POST from the activeperiod Select2 input box?

<!--        CARD 1-->
    <div class="row">
        <div class="col-md-3">
            <?php
            Card::create(array(
                //:activeperiod is sql parameter (basicaly $activestore), 
                //then ":activeperiod"=>$this->params["activeperiod"], is replacing :activeperiod with "activeperiod" assocArray
                //
                "value"=>$this->src("kazzicom_kpi")->query("SELECT MetricValue FROM tbl_KPIMetrics where Client='Kazzicom' and YearMonth= :activeperiod and MetricID=1")->params(array(
                ":activeperiod"=>$this->params["activeperiod"],
                )),
                "baseValue"=>$this->src("kazzicom_kpi")->query("SELECT MetricValue FROM tbl_KPIMetrics where Client='Kazzicom' and YearMonth= :compareperiod and MetricID=1")->params(array(
                ":compareperiod"=>$this->params["compareperiod"],
                )),
                "title"=>"Clients Acquired",
                "cssClass"=>array(
                    "card"=>"bg-info",
                    "title"=>"text-white",
                    "value"=>"text-white"
                )
            ));
            ?>
        </div> <!-- CARD1 END
KoolReport commented on Sep 6, 2021

May be you start with examining the value of $this->params["actionperiod"] by using var_dump() function. Trying to zoom down where is showing error, which widget showing error?

Sebastian Morales commented on Sep 6, 2021

There're 2 issues:

1 . In your Select2 input, you set "multiple" => false, thus its default parameter value should be a string/number instead of an array:

protected function defaultParamValues()
{
    ...
    return array(
        "activeperiod"=> $periodStore->get(0,"YearMonth"), // remove array()
        ...
    );
}

2 . In your Card widget;s "value" and "baseValue" you need to add method requestDataSending() to the end of your data pipe to get a value instead of an object:

            Card::create(array(
                "value"=>$this->src("kazzicom_kpi")->query("SELECT MetricValue FROM tbl_KPIMetrics where Client='Kazzicom' and YearMonth= :activeperiod and MetricID=1")->params(array(
                ":activeperiod"=>$this->params["activeperiod"],
                ))
                ->requestDataSending(),
                ...

Hope these helps.

Niall McGuirk commented on Sep 6, 2021

Hi Sebastian,

Thanks a lot, removing the array fixed it. It now shows the correct values, as per the input box parameters.

However, I just wanted to let you know that adding the ->requestDataSending(), to the cardValue and base made the Card break again. Can I ask what does the requestDataSending() do? and Is it part of KoolReports, or is it a PDO function?

The left box is without the requestDataSending(), the right is with.

Sebastian Morales commented on Sep 7, 2021

It looks like I made a mistake with requestDataSending() with Card widget. Pls try to remove it and see if the Card still works:

            Card::create(array(
                "value"=>$this->src("kazzicom_kpi")->query("SELECT MetricValue FROM tbl_KPIMetrics where Client='Kazzicom' and YearMonth= :activeperiod and MetricID=1")->params(array(
                ":activeperiod"=>$this->params["activeperiod"],
                )), // similarly for "baseValue"
                ...

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
solved

None