yii2如果列>>导出菜单结果为空页面10

时间:2015-09-29 06:46:08

标签: yii2 export-to-csv

我使用kartik\export\ExportMenu提供csv导出。 如果我想出口约。超过10列它只会产生一个没有错误的空页。此外,yii错误日志没有条目。使用较少的列可以。

我尝试了以下设置,但没有一个解决它:

  1. ' BATCHSIZE' => ..尝试从100到1000
  2. ' streamAfterSave' =>假
  3. 如果在创建文件后进行流式处理,则会创建任何空文件(0B)。

    有什么想法吗?感谢。

    ---剪辑---

    <?php
    $fullExportMenu = ExportMenu::widget([
                'dataProvider' => $dataProvider,
                'columns' => $gridColumns,
                'emptyText' => 'Keine Daten verfügbar.',
                'fontAwesome' => true,
                'filename' => 'Webshop_Produkte',
                'showColumnSelector' => false,
                //'noExportColumns' => [0,1]
                //'pjaxContainerId' => 'kv-pjax-container',
                'dropdownOptions' => [
                    'label' => 'Alle Daten',
                    'class' => 'btn btn-default'
                ],
                'batchSize' => 500,
                //'target' => ExportMenu::TARGET_POPUP,
                'stream' => false,
                'streamAfterSave' => false,
                'afterSaveView' => '@app/views/webshop-product/download',
                'folder' => '@app/web/downloads',
                //'linkPath' => '/downloads',
                //'exportConfig' => $exportConfig, 
    ]);
    
    echo $fullExportMenu . ' ' .
    GridView::widget([
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'columns' => $gridColumns,
        'pjax' => true,
        'pjaxSettings' => ['options' => ['id' => 'kv-pjax-container']],
        'panel' => [
            'type' => GridView::TYPE_PRIMARY,
            'heading' => '<h3 class="panel-title"><i class="glyphicon glyphicon-book"></i> Datei Export</h3>',
        ],
        // set a label for default menu
        'export' => [
            'label' => 'Aktuelle Seite',
            'fontAwesome' => true,
        ],
        // your toolbar can include the additional full export menu
        'toolbar' => [
            '{export}',
            // $fullExportMenu,
            ['content' =>
                Html::a('<i class="glyphicon glyphicon-repeat"></i>', ['index'], [
                    'data-pjax' => 0,
                    'class' => 'btn btn-default',
                    'title' => Yii::t('kvgrid', 'Reset Grid')
                ])
                . ' ' .
                Html::submitButton('Tabelle leeren', ['name' => 'truncate', 'class' => 'btn btn-danger',
                    'data-confirm' => 'Wollen Sie wirklich die Tabelle leeren?'
                    . 'Achtung: Löschen kann nicht rückgänig gemacht werden.'
                ])
                . ' ' .
                Html::submitButton('Alles', ['name' => 'download', 'class' => 'btn btn-danger',
                    'data-confirm' => 'Wollen Sie wirklich alles exportieren?'
                ])
            ],
        ]
    ]);
    ?>
    

    --- snap ---

0 个答案:

没有答案