Php – is there a limit on PHPExcel row height

PHPphpexcel

I am producing a xls (excel5 format) spreadsheet with PHPExcel. It works great except for one minor problem. I have three groups of text data that appear one after the other in the column. They are in the format

Item 1
a
b
c

Item 2
a
b
c

Item 3
a
b
c

All lines are separated by a new line (\n). The problem is that only the first two items appear. I use the following to set the row height to auto:

$phpExcel->getActiveSheet()->getDefaultRowDimension()->setRowHeight(-1);

I've tried setting the rowheight to 1000, while I get a tall row I don't get more data. I have printed out the string and examined it and there are no funky characters. Any ideas would be appreciated.

Best Answer

Don't simply assume that setting the default will work if individual rows have already been set with a height. It's better to allow the default to do its job for most rows, and to explicitly set those that you need to set

Use

$phpExcel->getActiveSheet()->getRowDimension(1)->setRowHeight(123);

to set each row that you need to set

And the maximum row height is 409

Related Topic