SimpleExcel.php
[Pman.Core] / SimpleExcel.php
index 696f4a9..a4bbebe 100644 (file)
@@ -294,12 +294,14 @@ class Pman_Core_SimpleExcel extends Pman
         if (is_object($clo)) {
             $cl = (array)$clo; // lossless converstion..
         }
-        print_R($cfg);exit;
+        
         if (isset($cfg['row_height'])) {
             $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']]  ;
@@ -343,6 +345,13 @@ class Pman_Core_SimpleExcel extends Pman
           
                 $worksheet->write($start_row+$r, $c, $v, $format);
             }
+            
+//            if(isset($col_cfg['autoHeight'])){
+                $vv = explode("\n", $v);
+                
+                $height = MAX(count($vv) * 10, $height);;
+                $worksheet->setRow($start_row+$r, $height);
+//            }
         }
         $this->start_row++;