setRowHeight(-1) doesn't work

Topics: Developer Forum, User Forum
Jan 26, 2011 at 7:02 AM
Edited Jan 26, 2011 at 7:07 AM


$objPHPExcel = new PHPExcel();
$objReader = PHPExcel_IOFactory::createReader('Excel5');
$objPHPExcel = $objReader->load("xls/report_template.xls");
$objPHPExcel->getActiveSheet()->setCellValue(A1, $val);
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');


I see "line1|line2" in Microsoft Office 2007, I have to resize manually the row but works well on LibreOffice 3.3.0 where I can see:


How can I resolve this problem on Microsoft Office 2007?

How can I simulate ALT+ENTER ?

Thanks for your help.

Jan 26, 2011 at 9:15 AM

It's cleaner if you just use \n rather than \r\n

But you also need to set text alignment to wrap