Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines
What error do you get when upgrade to 3.0.0, if it is related to DrillDown then you may change the name of DrillDown to LegacyDrillDown as we has reworked on the DrillDown for better. The structure changes very much so we decided to keep the old DrillDown in the name of LegacyDrillDown.
Sorry, I got busy. So, I have reports that work based on 2.x. If I drop in 3.x, I get the following error on all reports... These are just general reports based on DataTables etc
Fatal error: Uncaught Exception: Error on query >>> Operand should contain 1 column(s) in /data/subdomains/kpistage/html/koolreport/src/datasources/MySQLDataSource.php:298 Stack trace: #0 /data/subdomains/kpistage/html/koolreport/src/KoolReport.php(213): koolreport\datasources\MySQLDataSource->start() #1 /data/subdomains/kpistage/html/reports/joiners_and_leavers/index.php(10): koolreport\KoolReport->run() #2 {main} thrown in /data/subdomains/kpistage/html/koolreport/src/datasources/MySQLDataSource.php on line 298
If I remove 3.x and place in 2.x again, the report works.
So I tried upgrading to the newly released 3.25 from 2.43 and am still seeing issues.So my deployment process is to unzip the release into the webserver and name the folder koolreports_{versionnumber}.
I then rename the existing koolreports to koolreports_2.43 I then rename koolreports_3.25 to koolreports.
Only some of my reports work.
I've just figured out that the reports that done work have the following lines in them [with form filters on the view]
use \koolreport\inputs\Bindable;
use \koolreport\inputs\POSTBinding;
If I remove the two lines above, the report runs, for the most part, albeit without my filter input form working properly.
Oh yeah, sorry
Fatal error: Uncaught Exception: Error on query >>> Operand should contain 1 column(s) in /data/subdomains/kpistage/html/koolreport/src/datasources/MySQLDataSource.php:348 Stack trace: #0 /data/subdomains/kpistage/html/koolreport/src/KoolReport.php(300): koolreport\datasources\MySQLDataSource->start() #1 /data/subdomains/kpistage/html/reports/churn_by_gym/index.php(10): koolreport\KoolReport->run() #2 {main} thrown in /data/subdomains/kpistage/html/koolreport/src/datasources/MySQLDataSource.php on line 348
Sorry, I got VERY busy. I've just tried it with 3.25.4 and the problem still persists. Exact same error. Code below
<?php
require_once "../../koolreport/autoload.php";
use \koolreport\processes\Sort;
use \koolreport\processes\Filter;
use \koolreport\processes\Group;
use \koolreport\processes\Limit;
use \koolreport\processes\AccumulativeColumn;
use \koolreport\processes\DifferenceColumn;
class Joiners extends koolreport\KoolReport
{
use \koolreport\clients\Bootstrap;
use \koolreport\inputs\Bindable;
use \koolreport\inputs\POSTBinding;
use \koolreport\excel\ExcelExportable;
protected function defaultParamValues()
{
$this->src('query_source')
->query("Select gym_name from ff_gyms where gym_status in (1);")
->pipe($this->dataStore('select_all_gym_names_result'))
->requestDataSending();
$this->src('query_source')
->query("Select Distinct Year from kpi_joiners_leavers;")
->pipe($this->dataStore('select_all_years_result'))
->requestDataSending();
$this->src('query_source')
->query("Select Distinct Product from kpi_joiners_leavers;")
->pipe($this->dataStore('select_all_products_result'))
->requestDataSending();
$gymData = $this->dataStore("select_all_gym_names_result")->data();
$yearData = $this->dataStore("select_all_years_result")->data();
$productData = $this->dataStore("select_all_products_result")->data();
$gymList = array();
$yearList = array();
$productList = array();
foreach ($gymData as $item)
$gymList[] = $item["gym_name"];
foreach ($yearData as $item)
$yearList[] = $item["Year"];
foreach ($productData as $item)
$productList[] = $item["Product"];
return array(
"yearSelect"=>array(),
"gymSelect"=>array(),
"productSelect"=>array(),
"gymSelect"=>$gymList,
"yearSelect"=>$yearList,
"productSelect"=>$productList
);
}
protected function bindParamsToInputs()
{
return array(
"yearSelect"=>"yearSelect",
"gymSelect"=>"gymSelect",
"productSelect"=>"productSelect",
"options"
);
}
public function settings()
{
$config = include "../../includes/config.php";
return array(
"dataSources"=>array(
"query_source"=>$config["query_source"]
)
);
}
public function setup()
{
$this->src('query_source')
->query("select Year, Members from kpi_joiners_leavers "
. "where Gym IN (:gyms)"
. ";")
->params(array(
":gyms"=>$this->params["gymSelect"]
))
->pipe(new Group(array("by"=>"Year","sum"=>"Members")))
->pipe(new Sort(array("Year"=>"asc")))
->pipe(new AccumulativeColumn(array("Running Total"=>"Members")))
#->pipe(new DifferenceColumn(array("Difference"=>"Total")))
->pipe($this->dataStore('query_result'));
////////////////////////////////////////////////////
$this->src('query_source')
->query("Select Year, Month, MonthNum, Joiners, Leavers, Members Difference from kpi_joiners_leavers "
.
"where Gym IN (:gyms) and Year IN (:years) and Product IN (:products) "
. ";")
->params(array(
":gyms"=>$this->params["gymSelect"],
":years"=>$this->params["yearSelect"],
":products"=>$this->params["productSelect"]
))
->pipe(new Group(array("by"=>"Year,MonthNum","sum"=>"Joiners, Leavers, Difference")))
->pipe(new Sort(array("Year"=>"asc","MonthNum"=>"asc")))
->pipe(new AccumulativeColumn(array("Running Total"=>"Difference")))
->pipe($this->dataStore('joiner_leaver_result'));
////////////////////////////////////////////////////
$this->src('query_source')
->query("Select * from ff_gyms where gym_status in (1);")
->pipe(new Sort(array("gym_name"=>"asc")))
->pipe($this->dataStore('gym_names_result'));
////////////////////////////////////////////////////
$this->src('query_source')
->query("Select Distinct Year from kpi_joiners_leavers;")
->pipe(new Sort(array("Year"=>"asc")))
->pipe($this->dataStore('years_result'));
////////////////////////////////////////////////////
$this->src('query_source')
->query("Select Distinct Product from kpi_joiners_leavers;")
->pipe(new Sort(array("Product"=>"asc")))
->pipe($this->dataStore('products_result'));
////////////////////////////////////////////////////
}
}
Let KoolReport help you to make great reports. It's free & open-source released under MIT license.
Download KoolReport View demo