php - Cannot insert images using PHPExcel & Codeigniter -
i have problem in part. there no exported images in worksheet.
$objdrawing = new phpexcel_worksheet_drawing(); $objdrawing->setname("logo_sci"); $objdrawing->setdescription("logo_sci"); $objdrawing->setpath('./assets/images/sucofindo_logo.png'); $objdrawing->setcoordinates('c6'); $objdrawing->setheight(120); $objdrawing->setwidth(120); $objdrawing->setworksheet($objphpexcel->getactivesheet());
need help! thanks..
this code works me:
if (file_exists('includes/temp/signatures/'.$id.'.jpg')) { $objdrawing = new phpexcel_worksheet_drawing(); $objdrawing->setname('customer signature'); $objdrawing->setdescription('customer signature'); //path signature .jpg file $signature = fcpath.'/includes/temp/signatures/'.$id.'.jpg'; $objdrawing->setpath($signature); $objdrawing->setoffsetx(8); //setoffsetx works $objdrawing->setcoordinates('e38'); //set image cell e38 $objdrawing->setheight(75); //signature height $objdrawing->setworksheet($this->excel->getactivesheet()); //save }
as can see different code setpath(). needs root path file
note: i'm using phpexcel library of codeigniter. see here how: http://fally.ro/using-phpexcel-class-with-codeigniter/
php phpexcel export-to-excel worksheet
No comments:
Post a Comment