I used the following code to display the data into excel sheet.Now i need display the logo in excel sheet? How to do this?
$info_excel=$_REQUEST['excel_info'];
$month=$_REQUEST['m']; $year=$_REQUEST['y'];
$num = cal_days_in_month(CAL_GREGORIAN, $month,$year);
Yii::import('application.extensions.phpexcel1.JPhpExcel');
$xls = new JPhpExcel('UTF-8', false, 'My Test Sheet');
$image="<img src='".Yii::app()->request->baseUrl.'/themes/optisol/images/resign-icon.png'."'/>";
$heading=array(
1=>array(" Attendance for 01"."-".$month."-".$year." To ".$num."-".$month."-".$year." "),
);
$value=array(
1=>array('User Id', 'Emp No','Name','Branch','Designiation','Department','Present Day','Holiday','Leave Day','Week Day','Lop'),
);
$xls->addArray($heading);
$xls->addArray($value);
$xls->addArray($info_excel);
$xls->generateXML('attendance');
Try codding as a simple layout in your view component, then try this at the end of the code
//code goes here
$this->layout=false;
Yii::import('application.extensions.phpexcel.JPhpExcel');
$xls = new JPhpExcel('UTF-8', false);
$xls->generateXML('name_of_the_sheet');
//end of the view
This will generate you an excel file to save
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.