[resolved]A new "cell size" problem with picture

Topics: User Forum
Mar 17, 2010 at 9:51 AM
Edited Mar 17, 2010 at 9:55 AM

Hi,

 

I have some problems to use SetRowHeight and SetSize. Could you take a look to my php code ?

 

		$A = 'A'.($value+1);
		$excel->getActiveSheet()->getRowDimension($A)->setRowHeight(100);
		$excel->getActiveSheet()->getColumnDimension($A)->setWidth(100);
		
		$objDrawing = new PHPExcel_Worksheet_Drawing();
		$objDrawing->setName('StructPic');
		$objDrawing->setDescription('StructPic');		
		$objDrawing->setPath($picpath.$pngfile);
		//$objDrawing->setOffsetX(0);
		//$objDrawing->setOffsetY(0);
		$objDrawing->setHeight(100);
		$objDrawing->setWidth(100);
		$objDrawing->setCoordinates($A);
		$objDrawing->setWorksheet($excel->getActiveSheet());	
		
		
		//$excel->getActiveSheet()->getColumnDimension($A)->setAutoSize(true);

 

Wherever I inserted setRowHeight / SetWidth it didn't work. I have the last code of PHPExcel (svn) and openoffice 3.2.0.

Thanks,

 

regards

Mar 18, 2010 at 11:01 AM

No idea ?

 

Developer
Mar 19, 2010 at 1:01 AM

Instead of this:

$excel->getActiveSheet()->getRowDimension('A1')->setRowHeight(100);
$excel->getActiveSheet()->getColumnDimension('A1')->setWidth(100);

Use this:

$excel->getActiveSheet()->getRowDimension('1')->setRowHeight(100);
$excel->getActiveSheet()->getColumnDimension('A')->setWidth(100);
Mar 19, 2010 at 10:28 AM

Thanks a lot. It's ok now.