| Spreadsheet-WriteExcel-FromDB documentation | view source | Contained in the Spreadsheet-WriteExcel-FromDB distribution. |
Spreadsheet::WriteExcel::FromDB - Convert a database table to an Excel spreadsheet
use Spreadsheet::WriteExcel::FromDB;
my $dbh = DBI->connect(...);
my $ss = Spreadsheet::WriteExcel::FromDB->read($dbh, $table_name);
$ss->ignore_columns(qw/foo bar/);
# or
$ss->include_columns(qw/foo bar/);
$ss->restrict_rows('age > 10');
print $ss->as_xls;
# or
$ss->write_xls('spreadsheet.xls');
This module exports a database table as an Excel Spreadsheet.
The data is not returned in any particular order, as it is a simple task to perform this in Excel. However, you may choose to ignore certain columns, using the 'ignore_columns' method.
Creates a spreadsheet object from a database handle and a table name.
Accessor / mutator methods for the database handle and table name.
$ss->restrict_rows('age > 10');
An optional 'WHERE' clause for restricting the rows returned from the database.
$ss->ignore_columns(qw/foo bar/);
Output all columns, except these ones, to the spreadsheet.
$ss->include_columns(qw/foo bar/);
Only include these columns into the spreadsheet.
print $ss->as_xls;
Return the table as an Excel spreadsheet.
$ss->write_xls('spreadsheet.xls');
Write the table to a spreadsheet with the given filename.
Dates are handled as strings, rather than dates.
Tony Bowden
Please direct all correspondence regarding this module to: bug-Spreadsheet-WriteExcel-Simple@rt.cpan.org
Copyright (C) 2001-2005 Tony Bowden. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
| Spreadsheet-WriteExcel-FromDB documentation | view source | Contained in the Spreadsheet-WriteExcel-FromDB distribution. |