Export To Excel With Filtering From Cgridview

In my controller, I have the following code:

public function actionExport() {

// Load data

$model = Test::model()-> findAll();

// I tried to replace it with $model = Test::model()-> search();

// Export it

$this-> toExcel($model, array(),'DataExport',array('creator'=>'B'), 'Excel5' );


Added a simple link on the header above the CGridView and it works well.

It works great but pulls all the data for the controller based on the pagesize defined in the model (eg only 10 records)

I would like to have the option to pull all or the set of data based on the "Advanced Search" criteria.

I have really struggled to determine how to do this. I am new to Yii.

Thanks for any help!