New report
Creating a new empty report #
First choose menu item Report -> New
:
A new empty report with only a data source item is created:
Set the data source #
Click on the item's Templates
button to show a modal of data source templates:
Double click on your chosen template's screenshot or code to copy its code into the data source's editor:
Note: A data source item's code must be a statement that defines a variable called $datasourceSetting
:
$datasourceSetting = ...
If your data source setting is of relational database type, there needs to be a SQL query as well to retrieve data from the sourced database:
If your data source setting is of report-based type, there needs to be a datastore name as well to retrieve data from the sourced report. The name should be formatted as "result_< number >" where < number > is the data result of process < number > of the sourced report:
Edit the code to your likes and click on the item's Preview
button to request a retrieved data preview:
Add a process #
Once you have successfully got data from the data source item, click on the Add Process
button at the end of the report to create a new empty process:
Click on the item's Templates
button to show a modal of process templates:
Double click on your chosen template's screenshot or code to copy its code into the process' editor:
Note: A process item's code must be a statement that defines a variable called $process
:
$process = ...
Each process uses the result data of the last process (or data source) before it and outputs its processed data to the next process or visualization.
Edit the code to your likes and click on the item's Preview
button to request a processed data preview:
Add a visualization #
Once you have successfully got data from the data source or a process item, click on the Add Visualization
button at the end of the report to create a new empty visualization:
Click on the item's Templates
button to show a modal of visualization templates:
Double click on your chosen template's screenshot or code to copy its code into the visualization' editor:
Note: A visualization item's code must be a statement that creates a KoolReport widget:
\koolreport\widgets\google\AreaChart::create(...);
All visualization template codes use example static array data. To use the result data of the last process (or data source) before a visualization change its "dataSource" line to:
"dataSource" => $this->dataStore("result"),
Edit the code to your likes and click on the item's Preview
button to request a visualized widget preview:
Complete report #
Here is a simple report that includes a working data source, a working process, and a working visualization:
Get started with KoolReport
KoolReport will help you to construct good php data report by gathering your data from multiple sources, transforming them into valuable insights, and finally visualizing them in stunning charts and graphs.