Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines
select
BM.CODE AS CODE,
XU.FULLNAME AS CALLERNAME,
FMSB.NAME AS BINA,
F.NAME AS KAT,
W.NAME AS KANAT,
FMS.LOCATIONCODE AS LOCATIONCODE,
FMS.BUSINESS_NAME AS LOCATIONNAME,
date_format(BM.IDATE, '%d/%m/%Y %H:%i:%s') AS IDATE,
date_format(BM.PLANNEDDATE, '%d/%m/%Y %H:%i:%s') AS PLANNEDDATE,
BMSL.ITEMREF AS PERFORMANCE_PARAM,
BMSL.CATEGORYCODE AS CATEGORYCODE,
IF(EK18.ISTENEN_SEC = '', 'Tanımlı Değil', formatTime(EK18.ISTENEN_SEC)) AS YANITLAMA,
IF(EK18.D_ISTENEN_SEC = '', 'Tanımlı Değil', formatTime(EK18.D_ISTENEN_SEC)) AS DUZELTME,
date_format(BM.TDATE, '%d/%m/%Y %H:%i:%s') AS TDATE,
date_format(BM.TARGET_FDATE, '%d/%m/%Y %H:%i:%s') AS TARGET_FDATE,
X1.DISPVALUE AS ISSUE_STATUSNAME,
date_format(responded.IDATE, '%d/%m/%Y %H:%i:%s') AS YANITLAMA_ZAMANI,
date_format(fixed.IDATE, '%d/%m/%Y %H:%i:%s') AS DUZELTME_ZAMANI,
date_format(BM.UDATE , '%d/%m/%Y %H:%i:%s') AS UDATE,
if(EK18.ISMTBKT = '1', 'Var', 'Yok') AS MUTABAKAT,
EK18.THP AS HATA_PUANI,
CAST( EK18.HIZMET_KO AS DECIMAL(12,6)) AS KESINTI_ORANI
FROM Z_EK18 EK18
LEFT OUTER JOIN BM ON EK18.HCODE = BM.CODE
LEFT OUTER JOIN XUSER XU ON BM.CALLERCODE = XU.CODE
LEFT OUTER JOIN CMPNY C ON XU.CMPNY = C.CODE
INNER JOIN BMSTATUS
ON BM.ISSUESTATUS = BMSTATUS.CODE AND BMSTATUS.TYPE = 'ISSUE' AND
BMSTATUS.LANG = '0' and BMSTATUS.PARENTCODE!='Open'
LEFT OUTER JOIN BMSL ON BM.SLACODE = BMSL.CODE
LEFT OUTER JOIN bmactivities responded
ON responded.MODULECODE = BM.CODE AND responded.NEWSTATUS = 'Responded' AND
responded.EXSTATUS IN ('WIP', 'Open')
LEFT OUTER JOIN bmactivities fixed ON fixed.MODULECODE = BM.CODE AND fixed.NEWSTATUS = 'Fixed' AND
fixed.EXSTATUS IN ('Durum28', 'DRM00002', 'Responded')
LEFT OUTER JOIN AAAA FMS ON FMS.LOCATIONCODE = BM.LOCATIONCODE
LEFT OUTER JOIN AAAA_BFW FMSB ON FMSB.CODE = FMS.BUILDINGCODE
LEFT OUTER JOIN AAAA_BFW F ON F.CODE = FMS.FLOORCODE
LEFT OUTER JOIN AAAA_BFW W ON W.CODE = FMS.WINGCODE
LEFT OUTER JOIN xdropboxes X1 on X1.REALVALUE=BMSTATUS.CODE and X1.UNIQUEVALUE='stissue_status'
WHERE 1=1 AND EK18.SERVICE_CODE = '1' AND FMSB.CODE in ('BU0001') AND F.CODE in ('FL00001') AND BMSTATUS.PARENTCODE in ('Close') AND BMSTATUS.CODE ='Closed' AND EK18.PERIOD = '202106' AND (EK18.THP > '0' OR EK18.HHP > '0')
GROUP BY EK18.HCODE
ORDER BY EK18.ID DESC
When this error is received, the sql has been checked. The reason for the error is that it cannot connect to the mysql object. During the mysql execute process, it enters the catch block and gives an error.
Setup Code:;
<?php
/**
* Created by PhpStorm.
* User: *********
* Date: 25.03.2019
* Time: 17:44
*/
namespace koolreport;
abstract class *******KoolReport extends KoolReport
{
const DATASOURCE_******* = "*******";
protected $query;
protected $reportName;
public function __construct($reportName, $params = array())
{
$this->reportName = $reportName;
parent::__construct($params);
}
protected function settings()
{
return array(
"dataSources"=>array(
self::DATASOURCE_*******=>array(
'host' => GP('............'),
'username' => GP('.............'),
'password' => GP('.................'),
'dbname' => GP('...........'),
'charset' => 'utf8',
'class' => "\koolreport\datasources\MySQLDataSource"
),
)
);
}
/**
* @return \koolreport\datasources\PdoDataSource DataSource
* @throws \Exception
*/
public function getDataSource(){
return $this->src(self::DATASOURCE_*******);
}
protected function OnBeforeSetup(){
if (!isNullOrEmpty($this->reportName) && method_exists($this, $this->reportName)) {
call_user_func(array($this, $this->reportName));
return true;
}
return false;
}
/**
* Calls reportName's Setup function
* @return void|null
*/
protected function setup()
{
call_user_func(array($this, $this->reportName."Setup"));
}
}
Pls try to create a mysqli connection with your datasource information using this command:
<?php
$connection = new \mysqli($host, $username, $password, $dbname);
var_dump($connection)
Pls check that $connection is created successfully. Then fill in the host, username, password and dbname information back to your report's datasource setting. Rgds,
Let KoolReport help you to make great reports. It's free & open-source released under MIT license.
Download KoolReport View demo