DataObjects/core.sql
[Pman.Core] / SimpleExcel.php
index 79a52f3..65e42c4 100644 (file)
@@ -25,7 +25,9 @@
                 'header'=> "Thumbnail",
                 'dataIndex'=> 'id',
                 'width'=>  75,
-                'renderer' => array($this, 'getThumb')
+                'renderer' => array($this, 'getThumb'),
+ *              'color' => 'yellow', // set color for the cell which is a header element
+ *              'fillBlank' => 'gray', // set the color for the cell which is a blank area
             ),
         
         // if this is set then it will add a tab foreach one.
@@ -159,15 +161,21 @@ class Pman_Core_SimpleExcel extends Pman
             if (isset($cfg['row_height'])) {
                 $worksheet->setRow($start_row +$r, $cfg['row_height']);
             }
-           
+            
             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($data['fillBlank'])){
-                        $worksheet->write($start_row+$r, $c, '', $formats[$data['fillBlank']]);
+                
+                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);