| 1 |
NAME |
| 2 |
Spreadsheet::WriteExcel::Simple - A simple single-sheet Excel document |
| 3 |
|
| 4 |
SYNOPSIS |
| 5 |
my $ss = Spreadsheet::WriteExcel::Simple->new; |
| 6 |
$ss->write_bold_row(\@headings); |
| 7 |
$ss->write_row(\@data); |
| 8 |
|
| 9 |
print $ss->data; |
| 10 |
# or |
| 11 |
$ss->save("filename.xls"); |
| 12 |
|
| 13 |
DESCRIPTION |
| 14 |
This provides an abstraction to the Spreadsheet::WriteExcel module for |
| 15 |
easier creation of simple single-sheet Excel documents. |
| 16 |
|
| 17 |
In its most basic form it provides two methods for writing data: |
| 18 |
write_row and write_bold_row which write the data supplied to the next |
| 19 |
row of the spreadsheet. |
| 20 |
|
| 21 |
However, you can also use $ss->book and $ss->sheet to get at the |
| 22 |
underlying workbook and worksheet from Spreadsheet::WriteExcel if you |
| 23 |
wish to manipulate these directly. |
| 24 |
|
| 25 |
METHODS |
| 26 |
new |
| 27 |
my $ss = Spreadsheet::WriteExcel::Simple->new; |
| 28 |
|
| 29 |
Create a new single-sheet Excel document. You should not supply this a |
| 30 |
filename or filehandle. The data is stored internally, and can be |
| 31 |
retrieved later through the 'data' method or saved using the 'save' |
| 32 |
method. |
| 33 |
|
| 34 |
write_row / write_bold_row |
| 35 |
$ss->write_bold_row(\@headings); |
| 36 |
$ss->write_row(\@data); |
| 37 |
|
| 38 |
These write the list of data into the next row of the spreadsheet. |
| 39 |
|
| 40 |
Caveat: An internal counter is kept as to which row is being written to, |
| 41 |
so if you mix these functions with direct writes of your own, these |
| 42 |
functions will continue where they left off, not where you have written |
| 43 |
to. |
| 44 |
|
| 45 |
data |
| 46 |
print $ss->data; |
| 47 |
|
| 48 |
This returns the data of the spreadsheet. If you're planning to print |
| 49 |
this to a web-browser, be sure to print an 'application/excel' header |
| 50 |
first. |
| 51 |
|
| 52 |
book / sheet |
| 53 |
my $workbook = $ss->book; |
| 54 |
my $worksheet = $ss->sheet; |
| 55 |
|
| 56 |
These return the underlying Spreadsheet::WriteExcel objects representing |
| 57 |
the workbook and worksheet respectively. If you find yourself making |
| 58 |
more that a trivial amount of use of these, you probably shouldn't be |
| 59 |
using this module, but using Spreadsheet::WriteExcel directly. |
| 60 |
|
| 61 |
save |
| 62 |
$ss->save("filename.xls"); |
| 63 |
|
| 64 |
Save the spreadsheet with the given filename. |
| 65 |
|
| 66 |
BUGS |
| 67 |
This can't yet handle dates in a sensible manner. |
| 68 |
|
| 69 |
AUTHOR |
| 70 |
Tony Bowden |
| 71 |
|
| 72 |
BUGS and QUERIES |
| 73 |
Please direct all correspondence regarding this module to: |
| 74 |
[email protected] |
| 75 |
|
| 76 |
SEE ALSO |
| 77 |
Spreadsheet::WriteExcel. John McNamara has done a great job with this |
| 78 |
module. |
| 79 |
|
| 80 |
COPYRIGHT |
| 81 |
Copyright (C) 2001-2005 Tony Bowden. All rights reserved. |
| 82 |
|
| 83 |
This module is free software; you can redistribute it and/or modify it |
| 84 |
under the same terms as Perl itself. |
| 85 |
|