koolphp / 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
https://www.koolreport.com/
MIT License
229 stars 64 forks source link
data-analytics data-visualization datasource extended-packages framework mongodb mysql mysql-reporting-tools oracle php php-reporting-tools postgresql report-generator reporting reporting-engine reporting-pipeline reporting-tool sqlserver visualization

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.

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

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

  1. 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

  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:

KoolReport Pro

KoolReport Pro is the most advanced version of KoolReport. It includes latest KoolReport version plus all available advanced packages from KoolPHP Inc. It costs $129 for Developer License and $349 for Enterprise License. The licenses come with following benefits:

  1. Include all current package and future ones.
  2. Deploying on unlimited servers or projects.
  3. Royal free (no extra charged) when you delivered the KoolReport Pro with your commercial product.
  4. 1 year subscription to get free upgrades, bugs fixed and new released packages regardless price.
  5. 1 year priority support on forum. Your post will be marked with star and got fatest response by our expert.
  6. Enterprise License allows unlimited number of developers in organization.
  7. 50% discount on the next subscription.

If you have further inquiry on this special version, please go to our forum or email us at support@koolreport.com. We will get back to you in no time.

Some thoughts

KoolReport is the sum of our many years experience in making reports for our customers. We hope that it will help you to create powerful report with less effort. We love KoolReport very much and want it to be alive. We hope that you do too.

Being alive means that the source code continues to evolve, more features are added, and everything is back with professional support.

Please consider your purchase of extended packages or subscription as your donation. In exchange, we would like to send you gifts which are extensions or support services. By this way, we together contribute to the existence of KoolReport.

Our vision

"If you want to go fast, go alone. If you want to grow far, go together" - African Proverb

We have learned above statement through years of software development. We choose open-source as software model for KoolReport because we understand that:

  1. Alone, we never keep up with all time-changing needs
  2. Alone, we never have enough man power to serve well.

That's why we designed KoolReport to be simple and extensible. Simple to use and extensible for change. We would like to grow it to be a solid framework supported by market of packages providing various datasources, data processes, visualization widgets and report templates where users can find solution right away.

KoolReport wants to be foundation or ecosystem connecting people who need reporting solution and those who can provide it. All are invited to join us on market to provide excellent solutions. We believe people willing to pay for a good solution. And we are happy to share market and profit.

Vision are big, we take the first step. Join us!

To-do-list

Below are the things we are going to do:

  1. Evolve the structure of KoolReport and its functionalities
  2. Build market to push
    1. Connection to various datasources
    2. Data processing focus on: data cleaning, data analytics, data mining techniques
    3. More widgets to visualize data
  3. Build GUI for non-technical users
  4. Build ecosystem to handle big-data

Author

  1. KoolPHP Inc - A vendor of PHP components