I am generating Excel using PHPExcel.
All Code Works Fine.But Auto height code is not Working.
I have tried following code.
Apply row height on specific row
$objPHPExcel->getActiveSheet()->getRowDimension('7')->setRowHeight(-1);
Apply row height on for all row
$objPHPExcel->getActiveSheet()->getDefaultRowDimension(1)->setRowHeight(-1);
I have also tried word wrap property with it.
$objPHPExcel->getActiveSheet()
->getStyle('B7')
->getAlignment()
->setWrapText(true);
But it give me result as below:
Note : Working in MS office,Not Working in Apache open Office and LibreOffice
Have just added the following to the 01simple.php example
$value = "To be or not to be-that is the question: whether 'tis nobler in the mind to suffer the slings and arrows of outrageous fortune, or to take arms against a sea of troubles, and, by opposing, end them.";
$objPHPExcel->getActiveSheet()->setCellValue('A12', $value);
$objPHPExcel->getActiveSheet()->getRowDimension(12)->setRowHeight(-1);
$objPHPExcel->getActiveSheet()->getStyle('A12')->getAlignment()->setWrapText(true);
and this creates correctly wrapped output for both Excel2007 and Excel5 Writers
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With