neko8901
(Phburgoss)
1
Hi community,
Newbie here and trying to generate pdf in advanced.
Help me to generate tables generated by CRUD into pdf file.
advanced\backend\views\transactions
<?= GridView::widget([
'dataProvider' => $dataProvider,
// 'filterModel' => $searchModel,
'columns' => [
// ['class' => 'yii\grid\SerialColumn'],
'id',
'date',
'status',
'num_items',
'amount',
'discount',
'customer_id',
'productinventory_id',
//['class' => 'yii\grid\ActionColumn'],
],
]); ?>
Searching a lot of extension and tutorial<br />
and saw this extension kartik-v/yii2-mpdf (demos.krajee.com/mpdf)
trying to work on it but still no luck …
Thanks yii.
timmy78
(Timothee Planchais)
2
In your action index :
public function actionIndex()
{
...
$pdf = Yii::$app->pdf;//or $pdf = new Pdf...
$pdf->content = $this->render('index', ['searchModel'=>searchModel, 'dataProvider'=>$dataProvider]);
return $pdf->render();
}
neko8901
(Phburgoss)
3
Hi thanks a lot but got this error after wards
yii\base\ErrorException
Maximum function nesting level of ‘100’ reached, aborting!
hina_vaja
(hina vaja)
4
hello friends,
i am using mpdf in yii2.
i had setted all the parameters in autoload_namespaces.php.
i used it also in controller. In controller also found that class and showing method list also
but while in browser showing error
exception ‘yii\base\ErrorException’ with message ‘Class ‘mPDF’ not found’ in /var/www/mysite.in/demo/controllers/StudController.php:198
Stack trace:
#0 [internal function]: yii\base\Application->handleFatalError()
#1 {main}
in line
$mpdf = new mPDF();
how to short out it ?
subhapriya
(Subhapriyam)
5
Check the namespace of mpdf has included in your controller.