Tlbexcelview Export To Excel

Good day guys I have here a codes that search and filter data from the model and then will export to excel when clicked using tlbExcelView but my problem is it doesn’t filter the data being exported to excel but it display the filtered data in gridview thanks if someone can help me with this.




public function actionAdmin()

	{

		$model = new ShisMeddetails('search');

		$model->unsetAttributes();

		if (isset($_GET['ShisMeddetails'])) {

			$model->attributes = $_GET['ShisMeddetails'];

		}

		if (isset($_GET['export'])) {

			$production = 'export';

		} else {

			$production = 'grid';

		}

		$this->render('admin', array('model' => $model, 'production' => $production));

	}






Yii::app()->clientScript->registerScript('search', "

    $('#exportToExcel').click(function(){

        window.location = '". $this->createUrl('admin')  . "?' + $(this).parents('form').serialize() + '&export=true';

        return false;

    });

    $('.search-form form').submit(function(){

        $.fn.yiiGridView.update('some-grid', {

            data: $(this).serialize()

        });

        return false;

    });

");






$this->widget('application.components.widgets.tlbExcelView', array(

    'id'                   => 'some-grid',

    'dataProvider'         => $model->search(),

    'grid_mode'            => $production, // Same usage as EExcelView v0.33

    //'template'           => "{summary}\n{items}\n{exportbuttons}\n{pager}",

    'title'                => 'Inventory Report - ' . date('d-m-Y'),

    'creator'              => 'Your Name',

    'subject'              => mb_convert_encoding('' . utf8_encode(strftime('%e %B %Y')), 'ISO-8859-1', 'UTF-8'),

    'description'          => mb_convert_encoding('', 'ISO-8859-1', 'UTF-8'),

    'lastModifiedBy'       => '',

    'sheetTitle'           => 'Report on ' . date('m-d-Y'),

    'keywords'             => '',

    'category'             => '',

    'landscapeDisplay'     => true, // Default: false

    'A4'                   => true, // Default: false - ie : Letter (PHPExcel default)

    //'pageFooterText'       => '&RThis is page no. &P of &N pages', // Default: '&RPage &P of &N'

    //'automaticSum'         => true, // Default: false

    //'decimalSeparator'     => ',', // Default: '.'

    //'thousandsSeparator'   => '.', // Default: ','

    //'displayZeros'       => false,

    //'zeroPlaceholder'    => '-',

    //'sumLabel'             => 'Column totals:', // Default: 'Totals'

    //'borderColor'          => '00FF00', // Default: '000000'

    //'bgColor'              => 'FFFF00', // Default: 'FFFFFF'

    //'textColor'            => 'FF0000', // Default: '000000'

    'rowHeight'            => 20, // Default: 15

    'headerBorderColor'    => 'FF0000', // Default: '000000'

    'headerBgColor'        => 'CCCCCC', // Default: 'CCCCCC'

    'headerTextColor'      => '0000FF', // Default: '000000'

    'headerHeight'         => 10, // Default: 20

    //'footerBorderColor'    => '0000FF', // Default: '000000'

    //'footerBgColor'        => '00FFCC', // Default: 'FFFFCC'

    //'footerTextColor'      => 'FF00FF', // Default: '0000FF'

    //'footerHeight'         => 50, // Default: 20

    'zoomScale'            => 75, // Default: 100

    'columns'              => array(

									'dtlMed.med_name',

									'dtl_dosage',

									'dtl_qty',

									'dtl_maxlimit',

								),

)); ?>

<?php echo CHtml::button('Export to Excel',array('id'=>'exportToExcel')); ?>



Same problem here…

I use https://github.com/phreakbg/EExcelView/blob/master/EExcelView.php , try that one.