SimpleExcel.php
authorEdward <edward@roojs.com>
Wed, 23 Jan 2013 08:40:58 +0000 (16:40 +0800)
committerEdward <edward@roojs.com>
Wed, 23 Jan 2013 08:40:58 +0000 (16:40 +0800)
SimpleExcel.php

index cba4056..57007cc 100644 (file)
@@ -161,13 +161,18 @@ class Pman_Core_SimpleExcel extends Pman
             }
             
             foreach($cfg['cols']  as $c=>$col_cfg) {
-                $v = isset($cl[$col_cfg['dataIndex']]) ? $cl[$col_cfg['dataIndex']] : '';
-                if (empty($cl[$col_cfg['dataIndex']])) {
+                if(isset($cl[$col_cfg['dataIndex']])){
+                    $v = $cl[$col_cfg['dataIndex']];
+                }else{
                     if(isset($col_cfg['fillBlank'])){
                         $worksheet->write($start_row+$r, $c, '', $formats[$col_cfg['fillBlank']]);
                     }
                     continue;
                 }
+                
+                if (empty($cl[$col_cfg['dataIndex']])) {
+                    continue;
+                }
                 if (isset($col_cfg['txtrenderer'])) {
                     $v = call_user_func($col_cfg['txtrenderer'], 
                             $cl[$col_cfg['dataIndex']], $worksheet, $r+1, $c, $clo);