Spreadsheet::WriteExcel pre-release with enhanced image support

2 views
Skip to first unread message

jmcnamara

unread,
Jun 14, 2007, 5:57:24 PM6/14/07
to Spreadsheet::WriteExcel

A company has kindly sponsored the development of new features in
Spreadsheet::WriteExcel. I will give details at a later stage when the
work has progressed.

One of the side effects of this is that Spreadsheet::WriteExcel will
support full Excel 97 style images.

A pre-release is available that includes support for PNG images that
are compatible with cell comments, OpenOffice and Gnumeric. You can
download it here:

http://homepage.eircom.net/~jmcnamara/perl/prerel/Spreadsheet-WriteExcel-2.19.1.tar.gz

The module now has a new worksheet method called insert_image() that
is called as follows:

$worksheet->insert_image('B4', 'ourlogo.png');

The method takes the same parameters as insert_bitmap(), see the docs.
The insert_bitmap() method will be deprecated. See also the demo.pl
and images.pl programs in the examples directory of the distro.

Some benefits of the new image handling are:

* Support for PNG, JPG and BMP.
* Compatibility with OpenOffice and Gnumeric.
* Images can be selected in Excel.
* Repeated image are stored only once, thus reducing file size.
* Compatible with cell comments.

Some temporary caveats before the full release:

* Requires Digest::MD5 to be installed.
* Only PNG supported.
* Image scaling not active.
* Some of the tests fail.

I would be grateful if as many people as possible could try this out
and let me know of any problems.

John.
--

jmcnamara

unread,
Jun 16, 2007, 7:55:47 PM6/16/07
to Spreadsheet::WriteExcel

A first look at embedded charts in Spreadsheet::WriteExcel:

http://homepage.eircom.net/~jmcnamara/perl/embedded_chart.jpg

This was generated using an external template in a manner similar to
the existing chart mechanism:

http://search.cpan.org/~jmcnamara/Spreadsheet-WriteExcel-2.18/charts/charts.pod

Here is the code:

#!/usr/bin/perl -w

use strict;
use Spreadsheet::WriteExcel;

my $workbook = Spreadsheet::WriteExcel->new('aaa_001.xls');
my $worksheet = $workbook->add_worksheet();

$worksheet->store_formula('=Sheet1!A1');

$worksheet->write_col('A1', [ [1, 2],
[2, 3],
[3, 4],
[4, 5],
[5, 6],
]);

$worksheet->embed_chart('E3', 'chart01.bin');


This isn't in the above pre-release yet. It will be when it is a
little more stable.

John.
--

Yphus

unread,
Jun 22, 2007, 5:37:01 AM6/22/07
to Spreadsheet::WriteExcel
Hi John,

What a good day, a new release of WE !
I will test the pre-rel and let you know if I found some bugs.
bty do you plan to add autofilters in this new release ?

Thanks again for this excellent distro.

Sylvain.

Reply all
Reply to author
Forward
0 new messages