Permalink
Browse files

2.20 October 6 2007 - Major

    + Added autofilter() and filter_column() method and
      autofilter.pl example.

    + Added embed_chart() method to allow extracted chart
      templates to be embedded in a worksheet.
      Added demo4.pl and demo5.pl examples.

    + Added the insert_image() method and proper Excel 97
      style image handling for PNG and BMP.
      Images now work with Gnumeric and OpenOffice.
      insert_bitmap() is now deprecated.

    ! Made pane split optional when calling freeze_panes().
      Also renamed thaw_panes() as split_panes(). The old
      method name is still available, but deprecated.

    ! Renamed write_unicode() and write_unicode_le() methods
      to the more explicit write_utf16be_string() and
      write_utf16le_string(). The old method names are
      still available, but deprecated.
  • Loading branch information...
jmcnamara committed Oct 6, 2007
1 parent fed4a32 commit a3f19a47d00267a6077e43889c70ce7ef9e40d7b
Showing with 4,503 additions and 1,034 deletions.
  1. +31 −0 Changes
  2. +11 −3 MANIFEST
  3. +1 −1 META.yml
  4. +1 −1 Makefile.PL
  5. +69 −11 bin/chartex
  6. BIN charts/Chart1.xls
  7. BIN charts/Chart2.xls
  8. BIN charts/Chart3.xls
  9. BIN charts/Chart4.xls
  10. BIN charts/Chart5.xls
  11. +10 −0 charts/README
  12. +68 −10 charts/chartex.pl
  13. +3 −3 charts/demo1.pl
  14. +5 −4 charts/demo2.pl
  15. +6 −6 charts/demo3.pl
  16. +109 −0 charts/demo4.pl
  17. +41 −0 charts/demo5.pl
  18. +561 −234 doc/WriteExcel.html
  19. +6 −5 examples/README
  20. +266 −0 examples/autofilter.pl
  21. +5 −2 examples/bug_report.pl
  22. +2 −2 examples/demo.pl
  23. +8 −7 examples/formats.pl
  24. +3 −3 examples/hide_sheet.pl
  25. +6 −6 examples/images.pl
  26. +6 −7 examples/panes.pl
  27. BIN examples/republic.bmp
  28. BIN examples/republic.png
  29. +2 −2 examples/unicode_2022_jp.pl
  30. +2 −2 examples/unicode_8859_11.pl
  31. +2 −2 examples/unicode_8859_7.pl
  32. +2 −2 examples/unicode_big5.pl
  33. +2 −2 examples/unicode_cp1251.pl
  34. +2 −2 examples/unicode_cp1256.pl
  35. +2 −2 examples/unicode_cyrillic.pl
  36. +2 −2 examples/unicode_koi8r.pl
  37. +1 −1 examples/unicode_list.pl
  38. +2 −2 examples/unicode_polish_utf8.pl
  39. +2 −2 examples/unicode_shift_jis.pl
  40. +4 −4 examples/{unicode.pl → unicode_utf16.pl}
  41. +4 −4 examples/{unicode_japan.pl → unicode_utf16_japan.pl}
  42. +338 −151 lib/Spreadsheet/WriteExcel.pm
  43. +13 −7 lib/Spreadsheet/WriteExcel/BIFFwriter.pm
  44. +2 −2 lib/Spreadsheet/WriteExcel/Big.pm
  45. +2 −2 lib/Spreadsheet/WriteExcel/Chart.pm
  46. +4 −2 lib/Spreadsheet/WriteExcel/Format.pm
  47. +2 −2 lib/Spreadsheet/WriteExcel/Formula.pm
  48. +2 −2 lib/Spreadsheet/WriteExcel/OLEwriter.pm
  49. +2 −2 lib/Spreadsheet/WriteExcel/Utility.pm
  50. +580 −31 lib/Spreadsheet/WriteExcel/Workbook.pm
  51. +2 −2 lib/Spreadsheet/WriteExcel/WorkbookBig.pm
  52. +1,581 −433 lib/Spreadsheet/WriteExcel/Worksheet.pm
  53. +42 −47 t/21_escher.t
  54. +17 −17 t/22_mso_drawing_group.t
  55. +348 −0 t/26_autofilter.t
  56. +145 −0 t/27_autofilter.t
  57. +176 −0 t/28_autofilter.t
View
31 Changes
@@ -1,5 +1,36 @@
Revision history for Perl module Spreadsheet::WriteExcel.
+
+2.20 October 6 2007 - Major
+
+
+ + Added autofilter() and filter_column() method and
+ autofilter.pl example.
+
+ + Added embed_chart() method to allow extracted chart
+ templates to be embedded in a worksheet.
+ Added demo4.pl and demo5.pl examples.
+
+ + Added the insert_image() method and proper Excel 97
+ style image handling for PNG and BMP.
+ Images now work with Gnumeric and OpenOffice.
+ insert_bitmap() is now deprecated.
+
+ ! Made pane split optional when calling freeze_panes().
+ Also renamed thaw_panes() as split_panes(). The old
+ method name is still available, but deprected..
+
+ ! Renamed write_unicode() and write_unicode_le() methods
+ to the more explicit write_utf16be_string() and
+ write_utf16le_string(). The old method names are
+ still available, but deprected.
+
+
+2.19 June 14 2007 - Major
+
+ + Beta testing only. Not release to CPAN.
+
+
2.18 January 18 2007 - Minor
! Correct invalid user set_column() calls to prevent
View
@@ -29,6 +29,9 @@ t/21_escher.t
t/22_mso_drawing_group.t
t/23_note.t
t/24_txo.t
+t/26_autofilter.t
+t/27_autofilter.t
+t/28_autofilter.t
doc/index.html
doc/WriteExcel.html
@@ -54,6 +57,7 @@ doc/tpj0503-0004-05.gif
doc/win32ole.gif
examples/README
+examples/autofilter.pl
examples/autofit.pl
examples/bigfile.pl
examples/bug_report.pl
@@ -95,7 +99,7 @@ examples/panes.pl
examples/protection.pl
examples/regions.pl
examples/repeat.pl
-examples/republic.bmp
+examples/republic.png
examples/right_to_left.pl
examples/row_wrap.pl
examples/sales.pl
@@ -107,7 +111,6 @@ examples/stocks.pl
examples/tab2xls.pl
examples/tab_colors.pl
examples/textwrap.pl
-examples/unicode.pl
examples/unicode_2022_jp.pl
examples/unicode_2022_jp.txt
examples/unicode_8859_11.pl
@@ -121,14 +124,15 @@ examples/unicode_cp1251.txt
examples/unicode_cp1256.pl
examples/unicode_cp1256.txt
examples/unicode_cyrillic.pl
-examples/unicode_japan.pl
examples/unicode_koi8r.pl
examples/unicode_koi8r.txt
examples/unicode_list.pl
examples/unicode_polish_utf8.pl
examples/unicode_polish_utf8.txt
examples/unicode_shift_jis.pl
examples/unicode_shift_jis.txt
+examples/unicode_utf16.pl
+examples/unicode_utf16_japan.pl
examples/win32ole.pl
examples/writeA1.pl
examples/write_arrays.pl
@@ -145,8 +149,12 @@ charts/charts.txt
charts/demo1.pl
charts/demo2.pl
charts/demo3.pl
+charts/demo4.pl
+charts/demo5.pl
charts/Chart1.xls
charts/Chart2.xls
charts/Chart3.xls
+charts/Chart4.xls
+charts/Chart5.xls
bin/chartex
View
@@ -1,6 +1,6 @@
name: Spreadsheet-WriteExcel
abstract: Write to a cross platform Excel binary file
-version: 2.18
+version: 2.20
version_from: lib/Spreadsheet/WriteExcel.pm
installdirs: site
requires:
View
@@ -13,7 +13,7 @@ WriteMakefile(
'NEEDS_LINKING' => 0,
'PREREQ_PM' => { Parse::RecDescent => 0,
File::Temp => 0,
- OLE::Storage_Lite => 0.14
+ OLE::Storage_Lite => 0.14,
},
'dist' => { COMPRESS => 'gzip --best', SUFFIX => 'gz' },
'EXE_FILES' => ['bin/chartex'],
View
@@ -5,7 +5,7 @@
# chartex - A utility to extract charts from an Excel file for
# insertion into a Spreadsheet::WriteExcel file.
#
-# reverse('©'), September 2004, John McNamara, jmcnamara@cpan.org
+# reverse('©'), September 2007, John McNamara, jmcnamara@cpan.org
#
# Documentation after __END__
#
@@ -25,7 +25,8 @@ my $chart_index = 1;
my $sheet_index = -1;
my @sheetnames;
my @exrefs;
-
+my $depth_count = 0;
+my $max_font = 0;
#
# Do the Getopt and Pod::Usage routines.
@@ -109,29 +110,76 @@ while (read $tmpfile, $header, 4) {
my $filename = sprintf "%s%02d.bin", $chart_name, $chart_index;
open CHART, ">$filename" or die "Couldn't open $filename: $!";
binmode CHART;
- printf "\nExtracting \"%s\" to %s", $sheetnames[$sheet_index],
- $filename;
+
+ my $sheet_name = $sheetnames[$sheet_index];
+ $sheet_name .= ' embedded' if $depth_count;
+
+ printf "\nExtracting \%s\ to %s", $sheet_name, $filename;
$in_chart = 1;
$chart_index++;
}
- $sheet_index++;
+ $depth_count++;
+ }
+
+
+ # FBI, Chart fonts
+ if ($record == 0x1060) {
+
+ my $index = substr $data, 8, 2, '';
+ $index = unpack 'v', $index;
+
+ # Ignore the inbuilt fonts.
+ if ($index >= 5) {
+ $max_font = $index if $index > $max_font;
+
+ # Shift index past S::WE fonts
+ $index += 2;
+ }
+
+ $data .= pack 'v', $index;
+ }
+
+ # FONTX, Chart fonts
+ if ($record == 0x1026) {
+
+ my $index = unpack 'v', $data;
+
+ # Ignore the inbuilt fonts.
+ if ($index >= 5) {
+ $max_font = $index if $index > $max_font;
+
+ # Shift index past S::WE fonts
+ $index += 2;
+ }
+
+ $data = pack 'v', $index;
}
+
+
if ($in_chart) {
print CHART $header, $data;
}
+
# EOF
if ($record == 0x000A) {
$in_chart = 0;
+ $depth_count--;
+ $sheet_index++ if $depth_count == 0;
+;
}
}
-
-print "\n\n", ('=' x 60), "\n";
-print "Add the following near the start of your program.\n";
-print "Change variable name \$worksheet if required.\n\n";
+if ($chart_index > 1) {
+ print "\n\n";
+ print "Add the following near the start of your program\n";
+ print "and change the variable names if required.\n\n";
+}
+else {
+ print "\nNo charts found in workbook\n";
+}
for my $aref (@exrefs) {
my $sheet1 = $sheetnames[$aref->[1]];
@@ -148,9 +196,19 @@ for my $aref (@exrefs) {
$range = "'$range'" if $range =~ /[^\w:]/;
- print " \$worksheet->store_formula(\"=$range!A1\");\n";
+ print " \$worksheet->store_formula('=$range!A1');\n";
}
+print "\n";
+
+for my $i (5 .. $max_font) {
+
+ printf " my \$chart_font_%d = \$workbook->add_format(font_only => 1);\n",
+ $i -4;
+
+}
+
+
@@ -213,7 +271,7 @@ John McNamara jmcnamara@cpan.org
=head1 VERSION
-Version 0.01.
+Version 0.02.
=head1 COPYRIGHT
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
@@ -12,10 +12,14 @@ The files are as follows:
demo1.pl A demo of a line chart.
demo2.pl A demo of a pie chart.
demo3.pl A demo of a Open-High-Low-Close stock chart.
+ demo4.pl A demo of a Open-High-Low-Close stock chart (embedded).
+ demo5.pl A demo of a line chart (embedded).
Chart1.xls A template for use with demo1.pl.
Chart2.xls A template for use with demo2.pl.
Chart3.xls A template for use with demo3.pl.
+ Chart4.xls A template for use with demo4.pl.
+ Chart5.xls A template for use with demo5.pl.
* If you performed a normal installation then the chartex utility
should be installed to your 'somepath/perl/bin' directory and
@@ -33,6 +37,12 @@ You can run the examples as follows:
perl chartex.pl -c=demo3 Chart3.xls
perl demo3.pl
+ perl chartex.pl -c=demo4 Chart4.xls
+ perl demo4.pl
+
+ perl chartex.pl -c=demo5 Chart5.xls
+ perl demo5.pl
+
See charts.txt for further details of how to include externally generated charts in a Spreadsheet::WriteExcel file.
Oops, something went wrong.

0 comments on commit a3f19a4

Please sign in to comment.