Reports In Excel And Pdf

Hello guys, Im producing reports in excel and pdf using php excel and mpdf But when I create a report, In my excel report and pdf, it also includes the word Displaying records 10-10 which is present in my CGridView and also there are some numbers which I really dont where it came from.

Here is my code in producing excel and pdf in my controller:

PDF


else if (isset($_POST['PDF'])) {

                $account->attributes = $_POST['AccountForm'];

                $account->searchData2();

                $connection = Yii::app()->db;                

                $sql = $account->sql2;

                $rowcountsql = $account->rowcount2;

                $key = "AuditTrailID";

                $command = $connection->createCommand($rowcountsql);

                $count = $command->queryScalar(); // provide count for pagination

                // create data provider that works with CGridView

                $dataProvider = new CSqlDataProvider($sql, array(

                            'keyField' => $key,

                            'totalItemCount' => $count,

                            'pagination' => array(

                                'pageSize' => $count,

                            ),

                        ));

            $mPDF1 = Yii::app()->ePdf->mpdf();

 

            # You can easily override default constructor's params

            $mPDF1 = Yii::app()->ePdf->mpdf('', 'A5');

 

            # render (full page)

            //$mPDF1->WriteHTML($this->render('index', array(), true));

 

            # Load a stylesheet

            $stylesheet = file_get_contents(Yii::getPathOfAlias('webroot.css') . '/main.css');

            $mPDF1->WriteHTML($stylesheet, 1);

            # renderPartial (only 'view' of current controller)

            $mPDF1->WriteHTML($this->renderPartial('export2', array('dataProvider' => $dataProvider, 'account' => $account, '$auditdate' => $account->auditdate), true));

        

            # Outputs ready PDF

            $mPDF1->Output();

            }

Excel:




$else if (isset($_POST['Excel'])) {

                $account->attributes = $_POST['AccountForm'];

                $connection = Yii::app()->db;

                $account->searchData2();

                $sql = $account->sql2;

                $rowcountsql = $account->rowcount2;

                $key = "AuditTrailID";

                $command = $connection->createCommand($rowcountsql);

                $count = $command->queryScalar(); // provide count for pagination

                // create data provider that works with CGridView

                $dataProvider = new CSqlDataProvider($sql, array(

                            'keyField' => $key,

                            'totalItemCount' => $count,

                            'pagination' => array(

                                'pageSize' => $count,

                            ),

                        ));

                Yii::app()->request->sendFile("AuditTrail Report.xls", $this->renderPartial('export2', array('dataProvider' => $dataProvider, 'account' => $account, '$auditdate' => $account->auditdate),TRUE));

                $this->render('audittrail', array('dataProvider' => $dataProvider, 'account' => $account));

            }

you can hide it by adding this to your gridview


'summaryText'=>false,

I think those numbers are gridview pagination numbers, you can turn it off by adding this to your gridview


'enablePagination'=>false,

Oh I tried the ‘summaryText’=>false, and it worked but the pagination to false doesnt work, the numbers are still there, here is my code for my grid


<?php

                $factory = new CWidgetFactory();

                $widget = $factory->createWidget($this, 'EExcelView',

                array('dataProvider' => $dataProvider,

                'grid_mode' => 'export',

                'summaryText'=>false,

                'enablePagination' => false,

                'columns' => array('UserName:html:UserName',

                'Status:html:Status',

                'AccountTypeName:html:Account Type Name',

                'Name:html:Account Owner',

                'Email:html:Account Email',

                 )));

                $widget->init();

                $widget->run();

                ?>

I think those numbers at the end of my report are ID’s of each record retreive from the database which is my keyField.

Anyone who encountered this problem?? and a solution for this one?