Adding image to header

Topics: Developer Forum
Aug 1, 2014 at 9:07 AM
Hello, I'm having problems in adding an image to an excel header using PHPExcel... Ordinary text gets added without any problems but header simply doesn't show. When i look at the XML structure of the created of my xls file I can see that the added image is present in the media folder and that is properly referenced in XML using legacyDrawingHF tag but I can't see it when I open the file in Excel. This is my code:

        $objDrawing = new PHPExcel_Worksheet_HeaderFooterDrawing();

        $this->objPHPExcel->getActiveSheet()->getHeaderFooter()->addImage($objDrawing, PHPExcel_Worksheet_HeaderFooter::IMAGE_HEADER_LEFT);

        $objWriter = PHPExcel_IOFactory::createWriter($this->objPHPExcel, 'Excel2007');

Any suggestion what the problem might be?