KoolReport's Forum

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

Error: Call to a member function execute() on boolean #1525

Open Richb201 opened this topic on on Jul 13, 2020 - 3 comments

Richb201 commented on Jul 13, 2020

From MyReport ``

   $this->src('substantiator')
        ->query("
         SELECT employee_title, w2_wages sum(employees.w2_wages) AS wages 
         FROM employees WHERE campaign='$campaign'AND email='$email'
         JOIN employees ON employees.employee_title=titles.title
         GROUP BY employees.employee_title
         LIMIT 10
         ")
        ->pipe($this->dataStore("employees"))
        ->saveTo($EM);
From MyReport.view

2.4 Job Titles

<?php \koolreport\widgets\google\Table::create(array(

"dataStore"=>$this->dataStore("employees"),
"class"=>array(
    "table"=>"table table-hover"
)

)); ?> `` I am getting: An uncaught Exception was encountered Type: Error

Message: Call to a member function execute() on boolean

Filename: /app/vendor/koolreport/core/src/datasources/MySQLDataSource.php

Line Number: 384

Backtrace:

File: /app/vendor/koolreport/core/src/KoolReport.php Line: 315 Function: start

File: /app/application/controllers/Configure.php Line: 1992 Function: run

File: /app/index.php Line: 315 Function: require_once

David Winterburn commented on Jul 13, 2020

Hi Richard,

Why do you need to save to a process after piping a datastore:

        ->pipe($this->dataStore("employees"))
        ->saveTo($EM); 

A datastore is supposed to be the end of a data pipe. It's not a process, thus, you might not be able to use a number of functions of a process like pipe(), saveTo(), etc.

It's advisable to use saveTo() before piping a datastore. Let us know if you have any problem. Thanks!

Richb201 commented on Jul 13, 2020

Thanks. I'll move the saveTo's to before pipe. Is there is a user manual or guide that I am missing? I don;t see an explanation of how (or why) to use saveTo, ::HTML, or any of the other things you have suggested. Is there a pdf manual or user guide that you can send me?

BTW, that got rid of the error! thx

How to use the saveTo?

David Winterburn commented on Jul 14, 2020

A data pipe consists of a datasource at the start (->src("mysql")), multiple processes (or nodes) in the middle, and a datastore in the end. Method saveTo() allows you to capture a process/node to a variable. Then you could pipe other data pipes to that variable or pipe to multiple data pipes from it. For example:

$this->src("mysql")
->pipe(new ...)
->saveTo($node);

$this->src("csv")
->pipe(new ...)
->pipe($node);

$node->pipe(new ...)
->pipe($this->dataStore("ds1"));

$node->pipe(new ...)
->pipe($this->dataStore("ds2"));

Let us know if you have any other question. 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