Fixed typo, HIDE_GRIDLINES instead of HIDE_GRIDLINE
[p5sagit/Excel-Template.git] / lib / Excel / Template / Element / Cell.pm
index 3e5bb3c..1fd6bc7 100755 (executable)
@@ -40,11 +40,12 @@ sub _get_text
 }
 
 my %legal_types = (
-    'blank'   => 'write_blank',
-    'formula' => 'write_formula',
-    'number'  => 'write_number',
-    'string'  => 'write_string',
-    'url'     => 'write_url',
+    'blank'     => 'write_blank',
+    'formula'   => 'write_formula',
+    'number'    => 'write_number',
+    'string'    => 'write_string',
+    'url'       => 'write_url',
+    'date_time' => 'write_date_time',
 );
 
 sub render
@@ -84,7 +85,7 @@ sub render
     # Apply the cell width to the current column
     if (my $width = $context->get($self, 'WIDTH'))
     {
-        $width =~ s/\D//g;
+        $width =~ s/[^\d.]//g;
         $width *= 1;
         if ($width > 0)
         {
@@ -98,6 +99,11 @@ sub render
         $context->active_format,
     );
 
+    my $comment = $context->get($self, 'COMMENT');
+    if (defined $comment && length $comment){
+         $context->active_worksheet->write_comment($row, $col,$comment);
+    }
+
     return 1;
 }
 
@@ -154,6 +160,10 @@ This allows you to specify what write_*() method will be used. The default is to
 
 The legal types (taken from L<Spreadsheet::WriteExcel>) are:
 
+=item * COMMENT
+
+Add a comment to the cell
+
 =over 4
 
 =item * blank
@@ -166,9 +176,11 @@ The legal types (taken from L<Spreadsheet::WriteExcel>) are:
 
 =item * url
 
+=item * date_time
+
 =back
 
-q.v. L<Spreadsheet::WriteExcel> for more info.
+other write_* methods as defined defined L<Spreadsheet::WriteExcel> would be integrated by request
 
 =back