Eexcelview Export Multiple Table In Same Page

im using this extension to export date to excel

i have using dynamic table generation

my view code

$dataprovider = new CArrayDataProvider($item[‘content’], array(


'sort'=>array( ),





$columns = array();

$values = $dataprovider->getData();


foreach($values[0] as $key=>$val){


   $columns[] = array("name"=>$key,"value"=>'$data["'.$key.'"]',"type"=>"raw","header"=>isset($item['headerlabel'][$key])?$item['headerlabel'][$key]:$key); 




array( "summaryText"=>false,



  'itemsCssClass' => 'table table-striped',


 'htmlOptions'=>array("class"=>"report_grid_view report_grid_portlet_view")



the export link is append to each and every table but exporting the first table data only , if i click the 2nd 3rd or 4th i click it will export 1st table data only , what mistake i did

Well, very first thing : $dataprovider should be defined in your controller or in your model, not in your view.

Second thing :


$columns[] = array("name"=>$key,"value"=>'$data["'.$key.'"]',"type"=>"raw","header"=>isset($item['headerlabel'][$key])?$item['headerlabel'][$key]:$key); 


It miss one bracket "{" after the if

And what the hell is this condition ?


If you can’t read it, you can’t debug it.

So please, replace this Ternary Operator by something humanly readable.

And please, provide two raws of your excel.

If your code is not very clean, who can help you ?

Having a messy code is always a bad idea, and source of many bugs.

Please, use brackets, indentation, and use the Ternary Operator with extreme caution, only for trivial conditions easily readable.

And please, provide some example of your data.

please i have the same bugs

i use EEXcel extension do you have any idea how i can solve this problem