SkillAgentSearch skills...

Core

An Open Source PHP Reporting Framework that helps you to write perfect data reports or to construct awesome dashboards in PHP. Working great with all PHP versions from 5.6 to latest 8.0. Fully compatible with all kinds of MVC frameworks like Laravel, CodeIgniter, Symfony.

Install / Use

/learn @koolreport/Core

README

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.

View examples

Features

  1. Various datasources including relational database MySQL, SQL Server, Oracle or NoSQL like MongoDB, CSV or Excel files.
  2. Various data processes: data transformation, join, group, filter and etc.
  3. Awesome visualization through widgets charts and tables.
  4. Extended packages can be found at KoolReport Extended Packages

Changelog

Get started

System Requirement

  1. PHP 5.4 or higher

Installation

By composer

If you use composer, you can run following command to install the latest version

$ composer require koolreport/core

Manually Download

Please go to our Get Started page and following our guide to install.

What's included

koolreport/
├── core/
│   ├── src/
│   ├── tests/
│   └── autoload.php

Create your first report

Make two files SalesByCustomer.php and SalesByCustomer.view.php

/
├── koolreport/
├── myreport/
│   ├── 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/core/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

  1. Products vs Quarters
  2. Export To PDF
  3. DrillDown Report
  4. Pivot Table

.. and all examples.

Licenses

The KoolReport is licensed under MIT License.

Extended packages:

Many Free Packages

  • PlatesPhp: Use PlatesPHP template engine [Free]
  • Blade: Use Blade template engine [Free]
  • Twig: Use Twig template engine [Free]
  • 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](https://www
View on GitHub
GitHub Stars176
CategoryData
Updated4h ago
Forks33

Languages

PHP

Security Score

100/100

Audited on Mar 31, 2026

No findings