:no_entry:, (*1)
- !!! Library is deprecated !!!
:no_entry:, (*2)
, (*3)
Yii2 ExcelReport Extension
An extension for generate excel file from GridView content. When used with a GridView, extention saves the results of filtering and sorting in a file. Everything you see in the GridView will be imported into a file. All tasks are run in the background, the user can check the progress with the progressbar. It is not necessary to remain on the current page during the execution. You can continue working with the application. When the file is created, the download link will remain on the page with the widget until it is used, the user can use it at any time. When the file is downloaded, you can start generating a new report., (*4)
To run tasks in the background, the extension uses a queues., (*5)
Use the extension only makes sense to generate large files (> 50,000 lines)., (*6)
, (*7)
Installation
The preferred way to install this extension is through composer., (*8)
Either run, (*9)
php composer require --prefer-dist custom-it/yii2-excel-report
or add, (*10)
"custom-it/yii2-excel-report": "*"
to the require section of your composer.json
file., (*11)
Configuration
Before using the module, configure the queues, (*12)
Add progress behavior to Queue configuration:, (*13)
'queue' => [
// ... you Queue configuration ...
'as progress' => \customit\excelreport\ProgressBehavior::class,
],
Usage
Once the extension is installed, simply use it in your code by :, (*14)
$gridColumns = [
['class' => 'yii\grid\SerialColumn'],
'id',
'name',
'date',
'post',
['class' => 'yii\grid\ActionColumn'],
];
// Render widget
echo \customit\excelreport\ExcelReport::widget([
'columns' => $gridColumns,
'dataProvider' => $dataProvider,
]);
// Can be used with or without a GridView
echo GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'columns' => $gridColumns
]);