D
D
des1roer2015-06-05 13:34:21
Yii
des1roer, 2015-06-05 13:34:21

Yii export to excel from sql query?

I am using yiiheart which uses phpexel.
it correctly unloads the data received from cgridview (with filters). But the grid also displays data from other tables. How can I transfer my data set to pxexel?
in controller

public function actionExport()
    {
        $model=new FeS;
    $model->unsetAttributes();  // clear any default values
    if(isset($_POST['FeS']))
      $model->attributes=$_POST['FeS'];

    $exportType = $_POST['fileType'];
        $this->widget('ext.heart.export.EHeartExport', array(
            'title'=>'List of FeS',
            'dataProvider' => $model->search(),
            'filter'=>$model,
            'grid_mode'=>'export',
            'exportType'=>$exportType,
            'columns' => array(	                
          'id',
          'fe',
          's',
              ),
        ));
    }

as I understand it, you need to replace the dataprovider with your own and disable the filter?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
vyachin, 2015-06-08
@vyachin

https://github.com/hscstudio/yiiheart/issues here is the yiiheart support service I doubt that the developers of this extension "hang out" on the toaster ;-)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question