public function actionmis_feesExportToExcel($id) { $cash_data = MiscellaneousFeesPaymentCash::model()->findAll('miscellaneous_fees_payment_cash_student_id=' . $id); $cheque_data = MiscellaneousFeesPaymentCheque::model()->findAll('miscellaneous_fees_payment_cheque_student_id=' . $id); Yii::app()->request->sendFile(date('YmdHis') . '.xlsx', $this->renderPartial('/miscellaneousFeesPaymentTransaction/mis_pdf', array('cash_data' => $cash_data, 'cheque_data' => $cheque_data, 'id' => $id), true)); }
/** * Returns the data model based on the primary key given in the GET variable. * If the data model is not found, an HTTP exception will be raised. * @param integer the ID of the model to be loaded */ public function loadModel($id) { $model = MiscellaneousFeesPaymentCash::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }