This module allows for the creation of Excel binary files. Robust cell formatting, cell merges, multiple worksheets, formulae, printer specifications, The author has well documented this work, providing working examples that illustrate many of its features.
Why should you?
If you display a lot of data, and wish to allow users to export it in a readily usable format, this is the way to go.
Have never benchmarked it, but it does a lot of work, which takes a bit of time -- About 5 secs or so to create a a 2-worksheet spreadsheet about 15K
. This is still under development, and does not currently support Macros. Requires 5.6.0, support for IEEE 64 bit float, Text:: and Parse:: packages.
This is from the examples that come with the distro:
# Create a new workbook called simple.xls and add
# a worksheet
my $workbook = Spreadsheet::WriteExcel->new("simple.xls");
my $worksheet = $workbook->addworksheet();
# The general syntax is write($row, $column, $token). Note that row an
# column are zero indexed
# Write some text
$worksheet->write(0, 0, "Hi Excel!");
# Write some numbers
$worksheet->write(2, 0, 3); # Writes 3
$worksheet->write(3, 0, 3.00000); # Writes 3
$worksheet->write(4, 0, 3.00001); # Writes 3.00001
$worksheet->write(5, 0, 3.14159); # TeX revision no.?
# Write some formulas
$worksheet->write(7, 0, '=A3 + A6');
$worksheet->write(8, 0, '=IF(A5>3,"Yes", "No")');
# Wrte a hyperlink
$worksheet->write(10, 0, 'http://www.perl.com/');
Edit Masem 2002-01-23 - Added CODE tags
Edit abaxaba 2003-12-23 - Corrected Type - thanks ff
Are you posting in the right place? Check out Where do I post X? to know for sure.
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
Want more info? How to link or
or How to display code and escape characters
are good places to start.