Koolreport
This is an Open Source PHP Reporting Framework which you can use to write perfect data reports or to construct awesome dashboards using PHP
Install / Use
/learn @koolphp/KoolreportREADME
Notice: Change Repository
Starting from June 2019, we continue to support KoolReport at new repository https://github.com/koolreport/core. To install the latest KoolReport version, please use
composer require koolreport/core
Thank you very much!
KoolReport
KoolReport is an intuitive and flexible Open-Source PHP Reporting Framework for faster and easier report delivery. It gives you full control of data process as well as data visualization. It is fast, simple and can be extended in many ways.
Features
- Various datasources including relational database MySQL, SQL Server, Oracle or NoSQL like MongoDB, CSV or Excel files.
- Various data processes: data transformation, join, group, filter and etc.
- Awesome visualization through widgets charts and tables.
- Extended packages can be found at KoolReport Extended Packages
Changelog
- Version 3.25.4 (Feb 15th, 2019)
- Version 3.25.3 (Feb 14th, 2019)
- Version 3.25.1 (Feb 13rd, 2019)
- Version 3.25.0 (Feb 11st, 2019)
- Version 3.1.0 (Nov 17th, 2018)
- Version 3.0.0 (Nov 13rd, 2018)
- Version 2.78.0 (Jul 16th, 2018)
- Version 2.43.0 (Apr 20th, 2018)
- Version 2.42.0 (Mar 19th, 2018)
- Version 2.41.3 (Mar 02nd, 2018)
- Version 2.31.8 (Feb 05th, 2018)
- Version 2.31.7 (Jan 26th, 2018)
- Version 2.0.0 (Dec 23rd, 2017)
- Version 1.72.8 (Oct 30th, 2017)
- Version 1.61.5 (Sep 27th, 2017)
- Version 1.61.2 (Sep 21st, 2017)
- Version 1.47.3 (Aug 23rd, 2017)
- Version 1.34.9 (Jul 25th, 2017)
- Version 1.32.8 (Jul 5th, 2017)
- Version 1.27.6 (Jun 7th, 2017)
- Version 1.15.4 (May 22th, 2017)
- Version 1.11.4 (May 4th, 2017)
- Version 1.0.0 (April 3rd, 2017)
Get started
You can either clone our project or download directly from KoolReport Download.
If you use composer, you can run following command to install the latest version
$ composer require koolphp/koolreport
What's included
koolreport/
├── packages/
├── src/
│ ├── clients/
│ ├── core/
│ ├── datasources/
│ ├── processes/
│ └── widgets/
├── tests/
└── autoload.php
System Requirement
- PHP 5.4 or higher
Installation
Copy the folder koolreport into your project and it is ready to run. You can start creating report.
Create your first report
Make two files SalesByCustomer.php and SalesByCustomer.view.php
/
├── koolreport/
├── SalesByCustomer.php
├── SalesByCustomer.view.php
└── index.php
index.php
<?php
// index.php: Just a bootstrap file
require_once "SalesByCustomer.php";
$salesByCustomer = new SalesByCustomer;
$salesByCustomer->run()->render();
SalesByCustomer.php
<?php
require_once "../koolreport/autoload.php";
//Specify some data processes that will be used to process
use \koolreport\processes\Group;
use \koolreport\processes\Sort;
use \koolreport\processes\Limit;
//Define the class
class SalesByCustomer extends \koolreport\KoolReport
{
protected function settings()
{
//Define the "sales" data source which is the orders.csv
return array(
"dataSources"=>array(
"sales"=>array(
"class"=>'\koolreport\datasources\CSVDataSource',
"filePath"=>"orders.csv",
),
)
);
}
protected function setup()
{
//Select the data source then pipe data through various process
//until it reach the end which is the dataStore named "sales_by_customer".
$this->src('sales')
->pipe(new Group(array(
"by"=>"customerName",
"sum"=>"dollar_sales"
)))
->pipe(new Sort(array(
"dollar_sales"=>"desc"
)))
->pipe(new Limit(array(10)))
->pipe($this->dataStore('sales_by_customer'));
}
}
SalesByCustomer.view.php
<?php
use \koolreport\widgets\koolphp\Table;
use \koolreport\widgets\google\BarChart;
?>
<div class="report-content">
<div class="text-center">
<h1>Sales By Customer</h1>
<p class="lead">This report shows top 10 sales by customer</p>
</div>
<?php
BarChart::create(array(
"dataStore"=>$this->dataStore('sales_by_customer'),
"width"=>"100%",
"height"=>"500px",
"columns"=>array(
"customerName"=>array(
"label"=>"Customer"
),
"dollar_sales"=>array(
"type"=>"number",
"label"=>"Amount",
"prefix"=>"$",
"emphasis"=>true
)
),
"options"=>array(
"title"=>"Sales By Customer",
)
));
?>
<?php
Table::create(array(
"dataStore"=>$this->dataStore('sales_by_customer'),
"columns"=>array(
"customerName"=>array(
"label"=>"Customer"
),
"dollar_sales"=>array(
"type"=>"number",
"label"=>"Amount",
"prefix"=>"$",
)
),
"cssClass"=>array(
"table"=>"table table-hover table-bordered"
)
));
?>
</div>
You may download the source code sale_report.zip. And the result of this report can be previewed in here.
More examples
.. and all examples.
Licenses
The KoolReport is licensed under MIT License.
Extended packages:
- Laravel: Make KoolReport work seamlessly in Laravel PHP Framework [Free]
- CodeIgniter: Make KoolReport work seamlessly in CodeIgniter Framework [Free]
- MongoDB: Build report from MongoDB [Free]
- CleanData: Solution for your missing data [Free]
- QueryBuilder: Build fast and error-free SQL Query for your report [Free]
- Instant: Create widget instantly without setting up a full report [Free]
- Cache: Drive the speed and responsiveness of your report to the max [Free]
- Statistics: Provide various statistical measures for your data [Free]
- Bootstrap3: Create beautiful report with Bootstrap 3 [Free]
- Bootstrap4: Create modern report with Bootstrap 4 [Free]
- CloudExport: Export your report to PDF, JPG, PNG and other formats using cloud services [Free]
- Excel: Import and export data to Excel [$29]
- Cube: Turn your data into two dimensions cross-tab table [$19]
- Pivot: Build multi-dimenstional pivot table [$49]
- Export: Export your report to PDF, JPG, PNG and other formats [$29]
- Morris Chart: Use morris charts in your report [$9]
- Inputs: A simplest way to build dynamic reports [$29]
- BarCode: Generate BarCode and QRCode [$9]
- Sparklines: Create tiny charts [$9]
- DataGrid: Display data in table format, search, sort, group data and more.. [$19]
- DrillDown: Build awesome drill-down, drill-through report easily [$29]
- [ChartJS](https://www.koolreport.com/packages/cha

