Not Sure if this is a bug or my understanding

Topics: Developer Forum, Project Management Forum, User Forum
Jan 3, 2013 at 4:17 PM

Here is the code:

while($row = mysql_fetch_array($result))
  {
$sum_total=$rowNumber * $rowDivide;	
$image = "media/catalog/product/";


$objDrawing = new PHPExcel_Worksheet_Drawing();
$objDrawing->setName('My Image');
$objDrawing->setDescription('The Image that I am inserting');
$objDrawing->setPath("media/catalog/product/a/d/adidas-v10140-erkek-parka-v10140_8860_1.jpg");
$objDrawing->setCoordinates('A'.$sum_total);
$objDrawing->setWorksheet($objPHPExcel->getActiveSheet());


      
        $objPHPExcel->getActiveSheet()->setCellValue('D'.$sum_total,$row['sku']);
		 $objPHPExcel->getActiveSheet()->setCellValue('E'.$sum_total,$row['name']);
		$objPHPExcel->getActiveSheet()->setCellValue('F'.$sum_total, $row['price']);
		$objPHPExcel->getActiveSheet()->setCellValue('G'.$sum_total, $row['msrp']);
		$objPHPExcel->getActiveSheet()->setCellValue('H'.$sum_total, $row['small_image']);
		
		
	$rowNumber++;
  }

 

Okay so the problem that is happening, more specifically with this

$objDrawing->setPath("media/catalog/product/a/d/adidas-v10140-erkek-parka-v10140_8860_1.jpg");
When, I use this line, every loop just simply shows this image absolutely works fine.
But when I change the code to this:
$objDrawing->setPath("media/catalog/product/".$row['small_image']);
I receieve an error, it looks like it wont grab each image link.
Fatal error: Uncaught exception 'Exception' with message 'File media/catalog/productno_selection not found!'

Could anyone please suggest some advice?

Adam
Coordinator
Jan 3, 2013 at 11:38 PM

It's more like a standard error message saying that PHP can't find a file called "media/catalog/productno_selection"... though I'd expect it to complain about "media/catalog/product/no_selection". Does that file exist? Should $row['small_image'] contain a string value of "no_selection"?

Jan 5, 2013 at 7:16 PM

Replied over on the other forums:

https://github.com/PHPOffice/PHPExcel/issues/114