bad proportion image to put setWrapText cell(row)

Topics: Developer Forum, Project Management Forum, User Forum
Mar 23, 2012 at 3:50 PM

I have problem with dimension of image when I put in into setWrapText cell. The image has not the proportion size. For. example: image jpg have the real size 400x500pix, and when I put to cell where setWrapText, image have size: height 54% and width 8% (excel format image). When I don not set setWrapText, the image is proportion ok. Please try it.

$sheet = $objPHPExcel->getActiveSheet(0);

// Add a drawing to the worksheet
$objDrawing = new PHPExcel_Worksheet_Drawing();
$objDrawing->setPath("images/officelogo.jpg");
$objDrawing->setCoordinates("A1");					
$objDrawing->setWidth('50%');
$objDrawing->setWorksheet($sheet);

$sheet->setCellValue("B1", "test\ntest\ntest\ntest\ntest\ntest");
$sheet->getStyle("B1")->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT);
$sheet->getStyle("B1:D1")->getAlignment()->setWrapText(true);