From 80eeb96a861abf2506e02ffe38b48571ba68a7ed Mon Sep 17 00:00:00 2001 From: Edward Date: Mon, 9 Feb 2015 17:27:43 +0800 Subject: [PATCH] SimpleExcel.php --- SimpleExcel.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/SimpleExcel.php b/SimpleExcel.php index bd14f80d..31e3152b 100644 --- a/SimpleExcel.php +++ b/SimpleExcel.php @@ -299,7 +299,7 @@ class Pman_Core_SimpleExcel extends Pman $worksheet->setRow($start_row +$r, $cfg['row_height']); } - foreach($cfg['cols'] as $c=>$col_cfg) { + foreach($cfg['cols'] as $c => $col_cfg) { if(isset($col_cfg['dataIndex']) && isset($cl[$col_cfg['dataIndex']])){ $v = $cl[$col_cfg['dataIndex']] ; @@ -343,6 +343,14 @@ class Pman_Core_SimpleExcel extends Pman $worksheet->write($start_row+$r, $c, $v, $format); } + + if(isset($col_cfg['autoHeight'])){ + $vv = explode("\n", $v); + + $height = count($vv) * 20; + + $worksheet->write($start_row+$r, $height); + } } $this->start_row++; -- 2.39.2