i use phpoffice/phpexcel , have problem autofit row height.
i've found should use:
$height = -1; $sheet->getstyle("b$rownum")->getalignment()->setwraptext(true); $sheet->getrowdimension($rownum)->setrowheight($height); it doens't work me. if set $height = 40; works correctly.
i've found in phpexcel_worksheet_rowdimension class method setrowheight:
class phpexcel_worksheet_rowdimension { [...] private $_rowheight = -1; [...] public function setrowheight($pvalue = -1) { $this->_rowheight = $pvalue; return $this; } [...] } so - -1 default value row height , defaultly row height isn't fitted.
can me?
-1 default height: there isn't autosize row height in there column widths. it's not function ms excel provides, isn't done in phpexcel either. can set row height specific dimension, or tell apply default.
Comments
Post a Comment