DataObjects/Core_person_signup.php
[Pman.Core] / SimpleExcel.php
index 8009f71..675e348 100644 (file)
@@ -299,7 +299,10 @@ class Pman_Core_SimpleExcel extends Pman
             $worksheet->setRow($start_row +$r, $cfg['row_height']);
         }
         
-        foreach($cfg['cols']  as $c=>$col_cfg) {
+        $line_height = (isset($cfg['line_height'])) ? $cfg['line_height'] : 12;
+        $height = 0;
+        
+        foreach($cfg['cols']  as $c => $col_cfg) {
             
             if(isset($col_cfg['dataIndex']) && isset($cl[$col_cfg['dataIndex']])){
                 $v =    $cl[$col_cfg['dataIndex']]  ;
@@ -339,11 +342,16 @@ class Pman_Core_SimpleExcel extends Pman
                     || 
                     $dataFormat == 'string' ) {
                 $worksheet->writeString($start_row+$r, $c, $v, $format);
-                print_r($v);exit;
             } else {
           
                 $worksheet->write($start_row+$r, $c, $v, $format);
             }
+            
+            if(isset($col_cfg['autoHeight'])){
+                $vv = explode("\n", $v);
+                $height = MAX(count($vv) * $line_height, $height);;
+                $worksheet->setRow($start_row+$r, $height);
+            }
         }
         $this->start_row++;