kartik-v / yii2-mpdf

A Yii2 wrapper component for the mPDF library which generates PDF files from UTF-8 encoded HTML.
http://demos.krajee.com/mpdf
Other
161 stars 150 forks source link

Add ability to disable repeating table header row on new page #44

Closed adiramardiani closed 7 years ago

adiramardiani commented 7 years ago

The mpdf default always repating table header on a new page, but sometimes we need to disable this in mpdf documentation this feature should be affected, but in fact is not

I try to use

'tableOptions'=>[
   'class' => 'table table-bordered table-condensed',
   'repeat_header' => 0, // or 1
],

Still not affected

I think this options is can enable from grid/export(mpdf) options

kartik-v commented 7 years ago

You need to configure it in mPdf options (using mPdf component config). You are wrongly setting this in GridView::tableOptions.

adiramardiani commented 7 years ago

I try in grid export config, still not affected

'exportConfig' => [
    GridView::HTML => true,
    GridView::EXCEL => true,
    GridView::PDF => [
        'config' => [
            'options' => [
                'title' => $this->title,
                'repeat_header' => 0,
            ],
            'methods' => [ 
                'SetHeader'=>[date('d/m/Y H:i:s').' - '.Yii::$app->user->identity->name], 
                'SetFooter'=>['[ {PAGENO} ]'],
            ]
        ]
    ]
],

Can you able to give an example configuration ?

adiramardiani commented 7 years ago

Have a working example for this ? please :)