PHPackages                             chrisb34/yii2-report-grid - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. chrisb34/yii2-report-grid

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

chrisb34/yii2-report-grid
=========================

Yii-Framework gridview widget for totalling reports

5299[2 issues](https://github.com/chrisb34/yii2-reportgrid/issues)PHP

Since Nov 28Pushed 7y ago2 watchersCompare

[ Source](https://github.com/chrisb34/yii2-reportgrid)[ Packagist](https://packagist.org/packages/chrisb34/yii2-report-grid)[ RSS](/packages/chrisb34-yii2-report-grid/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Yii2-reportgrid
===============

[](#yii2-reportgrid)

Yii-Framework extension for reporting with totals and sub-totals. It supports export to CSV as well. There is no limit to the number of sub-totalling levels that you can have. You can also defer a sub-total or total to be displayed at the bottom of the grid in the Footer.

Warning
-------

[](#warning)

This is a development project and should not yet be relied on for production systems.

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist chrisb34/yii2-reportgrid "*"

```

or add

```
"chrisb34/yii2-reportgrid": "*"

```

to the require section of your `composer.json` file.

Usage
-----

[](#usage)

This extension is powerful reporting gridview. Unlike other totalling girdviews, all the totalling and sub-totaliing is done within the grid widget. this means that you sub-totals and totals can include closure functions and therefore reference other model attributes or relationships.

Once the extension is installed, use it like a normal gridview with a few extra options.

```
echo ReportGrid::widget([
        'dataProvider' => $dataProvider,
        'controlBreak' => true,
        'totalRowOptions' => ['class'=>'total-row'],
        'exportCSV' => true,
        'afterRow' => function() {},
        'totalRowOptions'
        'totalsHeader => true|false
        'columns' => [
           'attribute_name' => [
               'name' => optional: array key name
               'subTotal' => true/false/closure,
               'hAlign' => true
           ],
           'attribute_name' => [
               'name' => optional: array key name,
               // cause a break at break_level on this attribute
               'subTotalOn' => (int) break_level,
               'subTotal' => [
                   // note break level on closure
                   // useful for headings on break levels
                   // eg: function($model, $key, $index, $widget, $break) { if ($break==0) return 'Report Totals' ;
                   //                                                       elseif ($break==1) return 'Break 1 Totals'; .... }
                   'value' => string|attribute name|closure ~ function($model, $key, $index, $widget, $break) {}
                   'breakValue' => string|attribute name|closure ~ function($model, $key, $index, $widget, $break) {}
                   'showOnBreak => (int) break level,
                   'hideOnBreak => (int) break level,
                   'format' =>
                   'totalMethod' => ReportColumn::TOTAL_BREAKDOWN,
                   'totalOn' => string|attribute name|closure ~ function($model, $key, $index, $widget, $break) { return $model->attribute;  },
               ]
           ],
       ]
      ...
    ]);

```

You can see working demos at:

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance12

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/078778b7b9467a85b03ca404ba2e4a69db79494fa89cb7bfa7c7a1a166cec1c4?d=identicon)[chrisb34](/maintainers/chrisb34)

---

Top Contributors

[![chrisb34](https://avatars.githubusercontent.com/u/4489938?v=4)](https://github.com/chrisb34 "chrisb34 (14 commits)")

### Embed Badge

![Health badge](/badges/chrisb34-yii2-report-grid/health.svg)

```
[![Health](https://phpackages.com/badges/chrisb34-yii2-report-grid/health.svg)](https://phpackages.com/packages/chrisb34-yii2-report-grid)
```

###  Alternatives

[wi1dcard/china-divisions

中国行政区划地址库 SDK + 爬虫 + 数据。

2204.1k1](/packages/wi1dcard-china-divisions)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
