Yii Cgridview Export Into Excel Not Working On Pagination

my code export into excel works fine, 1 to 10 rows export if I filters rows that my code export filtered rows as my criteria. If I click to next page e.g 11 to 20 and then click on export button, export only first page 1 to 10 rows.

in my admin view export button code:

<div id='menub'><?php    $this->widget('zii.widgets.CMenu', array(






                                       'label'=>'<img align="absmiddle" alt = "'.Yii::t('internationalization','Export'). '" src = "'.Yii::app()->request->baseUrl.'/images/export.jpg" />',






above link call to excel method in expenses controller. code in my controller:

public function actionExcel() {

            $issueDataProvider = $_SESSION['report-excel'];

        $i = 0;

        $data = array();

        //fix column header. 

        //Could have used something like this - $data[]=array_keys($issueDataProvider->data[0]->attributes);. 

        //But that would return all attributes which i do not want


        $data[$i]['expenses_type_id'] = 'Type';

        $data[$i]['amount'] = 'Amount';

        $data[$i]['exp_date'] = 'Date';

        $data[$i]['description'] = 'Description';


        //populate data array with the required data elements

        foreach($issueDataProvider->data as $issue)


            $data[$i]['expenses_type_id'] = $issue->expensesType->name;

            $data[$i]['amount'] = $issue['amount'];

            $data[$i]['exp_date'] = $issue['exp_date'];

            $data[$i]['description'] = $issue['description'];




        $xls = new JPhpExcel('UTF-8', false, 'test');




I save data in


and in my Model:

public function getSearchCriteria()


    $criteria=new CDbCriteria;

        if(!empty($this->from_date) && empty($this->to_date))


            $criteria->condition = "exp_date >= '$this->from_date'";  // date is database date column field

        }elseif(!empty($this->to_date) && empty($this->from_date))


            $criteria->condition = "exp_date <= '$this->to_date'";

        }elseif(!empty($this->to_date) && !empty($this->from_date))


            $criteria->condition = "exp_date  >= '$this->from_date' and exp_date <= '$this->to_date'";


        $criteria->with = 'expensesType';

        $criteria->join = 'LEFT JOIN expenses_type p ON t.expenses_type_id = p.id'; 






        $criteria->order ='exp_date DESC';

    return $criteria;


    public function search()


        // @todo Please modify the following code to remove attributes that should not be searched.

$data = new CActiveDataProvider(get_class($this), array(

                        'pagination'=>array('pageSize'=> Yii::app()->user->getState('pageSize',                                           





         return new CActiveDataProvider(get_class($this), array(



every thing is works fine but on pagination. kindly help.