add image and text to the header.

Topics: User Forum
Aug 27, 2010 at 2:56 PM

hi there.

I've been reading your topics but still can not add image and text to header. Can someone help me please?

best regards.

here is my code:

$objDrawing = new PHPExcel_Worksheet_HeaderFooterDrawing();
$objDrawing->setName('PHPExcel logo');
$objDrawing->setPath('assets/images/logo.png');
$objDrawing->setHeight(36);

$currentHeader = $objPHPExcel->getActiveSheet()->getHeaderFooter()->getOddHeader();
$objPHPExcel->getActiveSheet()->getHeaderFooter()->setOddHeader($currentHeader.'&L&G');
$objPHPExcel->getActiveSheet()->getHeaderFooter()->addImage($objDrawing, PHPExcel_Worksheet_HeaderFooter::IMAGE_HEADER_LEFT);