一个开源的PHP报告框架,使报告交付更加容易和快速。


README

KoolReport 是一个直观且灵活的开源 PHP 报告框架,可快速轻松地交付报告。它使您能够完全控制数据处理和数据可视化。它速度快,简单,并且可以通过多种方式扩展。

View examples

功能

  1. 包括关系数据库 MySQL、SQL Server、Oracle 或 NoSQL(如 MongoDB、CSV 或 Excel 文件)在内的各种数据源。
  2. 包括数据转换、连接、分组、筛选等在内的各种数据处理。
  3. 通过小部件图表和表格实现出色的可视化。
  4. 扩展包可在 KoolReport 扩展包 中找到。

变更日志

开始使用

系统要求

  1. PHP 5.4 或更高版本

安装

通过 composer

如果您使用 composer,可以运行以下命令来安装最新版本

$ composer require koolreport/core

手动下载

请访问我们的 开始 页面,按照我们的指南进行安装。

包含内容

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

创建您的第一个报告

创建两个文件 SalesByCustomer.phpSalesByCustomer.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>

您可以下载源代码 sale_report.zip。此报告的结果可以在 此处预览

更多示例

  1. 产品与季度对比
  2. 导出为 PDF
  3. 钻取报告
  4. 交叉表

.. 以及 所有示例

许可证

KoolReport 适用于 MIT 许可证。

扩展包

许多免费包

  • PlatesPhp:使用 PlatesPhp 模板引擎 [免费]
  • Blade:使用 Blade 模板引擎 [免费]
  • Twig:使用 Twig 模板引擎 [免费]
  • Laravel:在 Laravel PHP 框架中无缝使用 KoolReport [免费]
  • CodeIgniter:在 CodeIgniter 框架中无缝使用 KoolReport [免费]
  • MongoDB:从 MongoDB 构建报告 [免费]
  • CleanData:解决您的缺失数据问题 [免费]
  • QueryBuilder:为您的报告构建快速且无错误的 SQL 查询 [免费]
  • Instant:无需设置完整报告即可立即创建小部件 [免费]
  • Cache:最大化提高报告的速度和响应速度 [免费]
  • Statistics:为您的数据提供各种统计指标 [免费]
  • Bootstrap3:使用 Bootstrap 3 创建美观的报告 [免费]
  • Bootstrap4:使用 Bootstrap 4 创建现代的报告 [免费]
  • CloudExport:使用云服务将报告导出为 PDF、JPG、PNG 等格式 [免费]

部分产品略有价格

  • Excel:导入和导出数据到 Excel [$49]
  • Cube:将数据转换为二维交叉表 [$29]
  • Pivot:构建多维透视表 [$69]
  • Export:将报告导出为 PDF、JPG、PNG 等格式 [$49]
  • Morris Chart:在报告中使用 Morris 图表 [$19]
  • Inputs:构建动态报告的最简单方法 [$49]
  • BarCode:生成条形码和二维码 [$19]
  • Sparklines:创建小型图表 [$19]
  • DataGrid:以表格形式显示数据,搜索、排序、分组数据等... [$29]
  • DrillDown:轻松构建令人惊叹的钻取和钻透报告 [$49]
  • ChartJS:用于报告的最美观和强大的图表库之一 [$49]
  • Amazing:使用现代和美观的主题来设计您的报告 [$49]
  • D3:用于您出色数据可视化的美观 D3 图表库 [$49]

KoolReport Pro

KoolReport Pro 是 KoolReport 最先进的版本。它包括最新的 KoolReport 版本以及 KoolPHP Inc. 提供的所有可用高级包。开发者许可证价格为 199 美元,团队许可证价格为 499 美元,企业许可证价格为 999 美元。这些许可证包含以下好处:

  1. 包括所有 当前和未来的包
  2. 可在 无限服务器或项目 上部署。
  3. 当您将 KoolReport Pro 与您的商业产品一起交付时,无需额外收费。
  4. 提供 1 年订阅,无论价格如何,均可免费升级、修复错误和发布新包。
  5. 在论坛上提供 1 年优先支持。您的帖子将被标记为星号,并由我们的专家快速响应。
  6. 企业许可证允许组织中的 无限数量的开发者
  7. 下一次订阅享有 50% 折扣

如果您对这款特别版本有进一步的问题,请访问我们的 论坛 或发送电子邮件至 support@koolreport.com。我们将立即回复您。

一些想法

KoolReport 是我们多年为客户制作报告经验的总结。我们希望它能帮助您以更少的努力创建强大的报告。我们非常喜欢 KoolReport,并希望它能充满活力。我们希望您也是如此。

充满活力意味着源代码会持续发展,增加更多功能,并伴有专业的支持。

请将您对扩展包或订阅的购买视为您的捐赠。作为交换,我们希望向您发送礼物,这些礼物是扩展或支持服务。通过这种方式,我们共同为 KoolReport 的存在做出贡献。

我们的愿景

"如果你想走得快,就一个人走。如果你想走得更远,就一起走" - 非洲谚语

我们通过多年的软件开发学到了上述观点。我们选择开源作为 KoolReport 的软件模型,因为我们了解

  1. 单独一人,我们永远无法跟上所有不断变化的需求
  2. 单独一人,我们永远没有足够的人手来提供良好的服务。

这就是为什么我们设计了 KoolReport,使其简单且可扩展。简单易用,可扩展以适应变化。我们希望将其发展成为一套坚实的框架,由提供各种数据源、数据处理、可视化小部件和报告模板的包市场支持,用户可以立即找到解决方案。

KoolReport 想要成为连接需要报告解决方案的人和能够提供它的人的基础或生态系统。所有人都被邀请加入我们,在市场上提供优秀的解决方案。我们相信人们愿意为好的解决方案付费。我们很高兴分享市场和利润。

愿景很大,我们迈出了第一步。加入我们吧!

待办事项清单

以下是我们要做的事情

  1. 发展 KoolReport 及其功能的结构
  2. 建立市场以推动
    1. 连接到各种数据源
    2. 数据处理的重点是:数据清理、数据分析、数据挖掘技术
    3. 提供更多可视化数据的控件
  3. 为非技术用户构建 GUI
  4. 构建处理大数据的生态系统

作者

  1. KoolPHP Inc - PHP 组件的供应商