Changes

Title
unchanged

Category
unchanged

Yii version
changed

Tags
changed

Content
changed

A Yii2 Gridview designed specifically for reporting
------------------===================================================

There are some very advanced grids in the Yii2 community, specifically Kartik's amazing gridview extensions but they all designed for interactive screen use.

[...]

But more importantantly it has sub-totalling and report totalling built into the gridview itself.

### Why is this significant
Because it enables you to use closures (anonymous functions) within the sub-total fields. For example, say we want to build a report on order items, with a break at order level. At the order level, we want to report something off the order model but the dataProvider is on the order-item level.

[...]

```php
$ php composer.phar require chrisb34/reportgrid "@dev"
```
or add:
```php
"chrisb34/yii2-report-grid": "@dev"
```
to the require section of your composer.json file. Then run:
```php
php composer.phar update
```
to get the updated package on your application install.
### Widget Setup
As with most Yii2 widgets, you control the using options on widget creation. This widget is based on the Yii2 gridview widget, so anything mentioned here is over and above the base options on the gridview widget

### Column Configuration
When you use sub-totalling in a report, your report layout must follow the same structure as your query. So the first thing is to define your query with the results in the correct order.