Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines
Please use the Cube
process. Here is the documentation.
Great, thanks
I managed to get all data in my report that I wanted. However I have a strange sorting issue. However, the periodes are not sorted correctly. 2017-3 is in the wrong place
$this->src('yunoport')
->query("Select companyname,companyparentid, tblresultid, DATE_FORMAT(tblresultdatetime,'%Y-%m-%d') as resultdate from ci_wizard_results LEFT JOIN ci_kiosks on ci_wizard_results.tblresultkioskname = ci_kiosks.kioskname LEFT JOIN ci_companies on ci_kiosks.kioskcompanyid = ci_companies.companyid WHERE `tblresultdatetime` >= DATE_FORMAT(DATE_ADD(NOW(),INTERVAL -1 YEAR),'%Y-%m-%d') AND companyname <> ''")
->pipe(new Sort(array(
"companyparentid"=>"asc",
"tblresultid"=>"desc",
)))
->pipe(new TimeBucket(array(
"resultdate"=>"month"
)))
->pipe(new Cube(array(
"row"=>"companyname",
"column"=>"resultdate",
"count"=>"tblresultid",
"sort"=>false
)))
->pipe(new ColumnMeta(array(
"{{all}}"=>array(
"type"=>"string",
"label"=>"Total",
"sort"=>false
))))
->pipe(new ColumnMeta(array(
"companyname"=>array(
"type"=>"string",
"label"=>"Company",
"sort"=>false
))))
->pipe($this->dataStore("wizardresults"));
Please use the ColumnSort to sort column by name
Example
->pipe(new ColumnsSort(array(
"{name}"=>"asc",
)))
Yes, you can, please use the "footer" of table. Please check the Aggregated Footer in Table documentation.
Let KoolReport help you to make great reports. It's free & open-source released under MIT license.
Download KoolReport View demo