iliaal / php_excel

PHP Extension interface to the Excel writing/reading library
http://ilia.ws
534 stars 131 forks source link

wrap text not working #194

Closed sgiacinto closed 7 years ago

sgiacinto commented 7 years ago

Hello, I cannot get the wrap function to work.

$wrap_text = $ex->addFormat();
$wrap_text->wrap(true); 

... $xlSheet1->setRowHeight(2,30, $wrap_text);

Doesn't cause anything to happen, the text still expands past the cell boundary even though there is space for it to wrap.

screen shot 2017-03-31 at 16 14 24
johmue commented 7 years ago

Seems it does not work with setRowHeight() but to me it looks like the libxl lib does not work properly here. For the moment you might want to get along with the normal write() method.

$b = new \ExcelBook();
$format = $b->addFormat();
$format->wrap(true);

$s = new \ExcelSheet($b, 'Sheet 1');
$s->write(1, 1, 'foo bar baz', $format);
sgiacinto commented 7 years ago

Thanks