I would like to display the whole text on a generated .xls with PHPExcel 1.8.0. Currently, the cell (actually the whole row) isn't resized even though it didn't set any row height.
here are some screenshots :
Here is my code :
$this->xls->getActiveSheet()->getRowDimension($this->row)->setRowHeight(-1);
$this->xls->getActiveSheet()->getStyle("A".$this->row.":F".$this->row)->getAlignment()->setWrapText(true);
$this->xls->getActiveSheet()->getCell("A".$this->row)->setValue(APPLICATION_ACADEMY);
$this->xls->getActiveSheet()->getCell("B".$this->row)->setValue(date("d/m/Y"));
$this->xls->getActiveSheet()->getCell("C".$this->row)->setValue($fait['nature'] === null ? $fait['codeNature'] : $fait['nature']);
$this->xls->getActiveSheet()->getCell("D".$this->row)->setValue($fait['etablissement']);
I used what i already found on stack (setTextWrap / setRowHeight(-1)) but it has no effect
Anyone got an idea ? Is it even possible ? thanks.
Below is working for me but its for single row:
$excel->getActiveSheet()->getRowDimension(1)->setRowHeight(-1);
To change height of all rows to auto you can do:
foreach($xls->getActiveSheet()->getRowDimensions() as $rd) {
$rd->setRowHeight(-1);
}
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