$this->worksheet = $worksheet;
$start_row = 0;
- print_r($cfg);exit;
+
if (!empty($cfg['head'])) {
foreach($cfg['head'] as $row) {
foreach($row as $c => $col) {
$worksheet->setRow($start_row +$r, $cfg['row_height']);
}
- foreach($cfg['cols'] as $c=>$col_cfg) {
+ $height = 10;
+
+ foreach($cfg['cols'] as $c => $col_cfg) {
if(isset($col_cfg['dataIndex']) && isset($cl[$col_cfg['dataIndex']])){
$v = $cl[$col_cfg['dataIndex']] ;
$worksheet->write($start_row+$r, $c, $v, $format);
}
+
+// if(isset($col_cfg['autoHeight'])){
+ $vv = explode("\n", $v);
+
+ $height = MAX(count($vv) * 12, $height);;
+ $worksheet->setRow($start_row+$r, $height);
+// }
}
$this->start_row++;