SimpleExcel.php
authorAlan Knowles <alan@roojs.com>
Mon, 1 Apr 2013 13:08:12 +0000 (21:08 +0800)
committerAlan Knowles <alan@roojs.com>
Mon, 1 Apr 2013 13:08:12 +0000 (21:08 +0800)
SimpleExcel.php

index 0c5885b..bd7d0e6 100644 (file)
@@ -269,7 +269,13 @@ class Pman_Core_SimpleExcel extends Pman
             
             $format = isset($col_cfg['format'])  && isset($formats[$col_cfg['format']] )   ? $formats[$col_cfg['format']] : false;
           //  print_R(array($start_row+$r, $c, $v, $format));exit;
-            $worksheet->write($start_row+$r, $c, $v, $format);
+          // handle 0 prefixes..
+            if (is_numeric($v) && substr($v,0,1) == '0') {
+                $worksheet->writeString($start_row+$r, $c, $v, $format);
+            } else {
+          
+                $worksheet->write($start_row+$r, $c, $v, $format);
+            }
         }
         $this->start_row++;