KoolReport's Forum

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

Generate a report based on data that are generated from a mysql query #904

Open Gayathri opened this topic on on Jun 4, 2019 - 1 comments

Gayathri commented on Jun 4, 2019
$ProcuctionEntriesDbs=array("3b2book","3b2journal","cebook","cejournal","dataconversionbook","dataconversionjournal","dataentrybook","dataentryjournal","epubbook","graphicsbook","graphicsjournal","jobanalysisbook","jobanalysisjournal","paginationbook","prepressbook","prepressjournal","proofreaderbook","proofreaderjournal","scannedepubbook","tebook","tejournal","texbook","xmljournal","xmlbook","ftpbook","ftpjournal");
	
	$MyProdQuery="";
	for($x=0;$x<sizeof($ProcuctionEntriesDbs);$x++)
	{
		$MyProdQuery.="(SELECT jobnoprefix,jobnosufix,journalname,enickid,eid,ename,fromtime,totime,duration,fn,process,minutes,date,time,noofpages,endpage,totalpage,remarks,articleid,platform from ".$ProcuctionEntriesDbs[$x]." where eid='".$eid."' and  str_to_date(date, '%d/%m/%Y')>=str_to_date('".$fromdate1."', '%d/%m/%Y') and  str_to_date(date, '%d/%m/%Y')<=str_to_date('".$todate1."', '%d/%m/%Y'))  ";
		if($x<sizeof($ProcuctionEntriesDbs)-1)
		{
			$MyProdQuery.=" UNION ";
		}
	}
	$MyProdQuery.="   order by time ASC";

How to write the above query in koolreport ....

KoolReport commented on Jun 4, 2019

You write the same codes and put inside setup() function:

function setup()
{
    // Your above code here
    $this->src("your-data-source-name")->query($MyProdQuery)
    ->pipe(...)
    ->pipe($this->dataStore("result"));
}

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