Exporting Cgridview Results To Csv File


Can anybody tell me how to create a csv file from CGridview?

i can try this but it’s single db record fetch http://www.yiiframework.com/wiki/306/exporting-cgridview-results-to-csv-file/

Note:my grid view is multiple table relational so how can this possible

Please help it’s Urgent

Best Regards,

Ankit Modi

Have you tried to use EExcelView extension? IMHO, it would be easier and more flexible to use as you can set it up like CGridView:

$this->widget('application.extensions.EExcelView', array(				









          'value'=>'$data->project->name'       // relational field                





Thanks, I already have it working.

Best Regards,

Ankit Modi


i try it,and i just see view all of data in CGridView,

how i can save it to format csv? or if i success, how i can see the result file…i have name it "reportTrx"

please explain more, thanks