Excel::Template is a layout system to use the data structure from HTML::Template
-and create a Microsoft Excel file. A few caveats:
-1) All limitations stated in Spreadsheet::WriteExcel are in force, as that is
- the module used for rendering.
-2) The output() method is not extremely well-tested.
-3) Not all the methods have been tested in all situations. I fully expect bugs
- to come back and have to be fixed.
+and create a Microsoft Excel file.
-Barring all of that, and a slight lack of features, it's a good module. Enjoy!
-
-Rob
+CAVEAT: All limitations stated in Spreadsheet::WriteExcel are in force, as that
+is the module used for rendering. If the XLS file is corrupted, I would first
+make sure you aren't doing anything that it says is bad.
use Excel::Template::Base;
use vars qw ($VERSION @ISA);
- $VERSION = '0.18';
+ $VERSION = '0.19';
@ISA = qw( Excel::Template::Base );
}
close INFILE;
}
- return !!1;
+ return ~~1;
}
*parse = \&parse_xml;
$_->render($context) for @{$self->{WORKBOOKS}};
- return !!1;
+ return ~~1;
}
sub register { shift; Excel::Template::Factory::register(@_) }
instead. The existing modules don't do the trick, as they require replication
of logic that's already been done within HTML::Template.
-Currently, only a small subset of the planned features are supported. This is
-meant to be a test of the waters, to see what features people actually want.
-
=head1 MOTIVATION
I do a lot of Perl/CGI for reporting purposes. In nearly every place I've been,
=head2 new()
-This creates a Excel::Template object. If passed a filename parameter, it will
+This creates a Excel::Template object. If passed a FILENAME parameter, it will
parse the template in the given file. (You can also use the parse() method,
described below.)
+new() accepts an optional BIG_FILE parameter. This will attempt to change the
+renderer from L<Spreadsheet::WriteExcel> to L<Spreadsheet::WriteExcel::Big>. You
+must have L<Spreadsheet::WriteExcel::Big> installed on your system.
+
+NOTE: L<Spreadsheet::WriteExcel::Big> and mod_perl clash for some reason. This
+is outside of my control.
+
=head2 param()
-This method is exactly like HTML::Template's param() method. Although I will
-be adding more to this section later, please see HTML::Template's description
-for info right now.
+This method is exactly like L<HTML::Template>'s param() method.
=head2 parse() / parse_xml()
=head1 SUPPORTED NODES
-This is just a list of nodes. See the other classes in this distro for more
+This is a partial list of nodes. See the other classes in this distro for more
details on specific parameters and the like.
Every node can set the ROW and COL parameters. These are the actual ROW/COL
-values that the next CELL tag will write into.
+values that the next CELL-type tag will write into.
=over 4
-=item * WORKBOOK
+=item * L<WORKBOOK|Excel::Template::Container::Workbook>
+
+This is the node representing the workbook. It is the parent for all other
+nodes.
+
+=item * L<WORKSHEET|Excel::Template::Container::Worksheet>
+
+This is the node representing a given worksheet.
+
+=item * L<IF|Excel::Template::Container::Conditional>
+
+This node represents a conditional expression. Its children may or may not be
+rendered. It behaves just like L<HTML::Template>'s TMPL_IF.
+
+=item * L<LOOP|Excel::Template::Container::Loop>
+
+This node represents a loop. It behaves just like L<HTML::Template>'s TMPL_LOOP.
+
+=item * L<ROW|Excel::Template::Container::Row>
+
+This node represents a row of data. This is the A in A1.
+
+=item * L<FORMAT|Excel::Template::Container::Format>
+
+This node varies the format for its children. All formatting options supported
+in L<Spreadsheet::WriteExcel> are supported here. There are also a number of
+formatting shortcuts, such as L<BOLD|Excel::Template::Container::Bold> and
+L<ITALIC|Excel::Template::Container::Italic>.
+
+=item * L<BACKREF|Excel::Template::Element::Backref>
+
+This refers back to a cell previously named.
-=item * WORKSHEET
+=item * L<CELL|Excel::Template::Element::Cell>
-=item * IF
+This is the actual cell in a spreadsheet.
-=item * LOOP
+=item * L<FORMULA|Excel::Template::Element::Formula>
-=item * ROW
+This is a formula in a spreadsheet.
-=item * CELL
+=item * L<RANGE|Excel::Template::Element::Range>
-=item * FORMULA
+This is a BACKREF for a number of identically-named cells.
-=item * BOLD
+=item * L<VAR|Excel::Template::Element::Var>
-=item * ITALIC
+This is a variable. It is generally used when the 'text' attribute isn't
+sufficient.
=back 4
=head1 SUPPORT
-This is currently beta-quality software. The featureset is extremely limited,
-but I expect to be adding on to it very soon.
+This is production quality software, used in several production web
+applications.
=head1 AUTHOR
- Rob Kinyon
- rob.kinyon@gmail.com
+ Rob Kinyon (rob.kinyon@gmail.com)
=head1 CONTRIBUTORS
-There is a mailing list at http://groups-beta.google.com/group/ExcelTemplate
+There is a mailing list at http://groups.google.com/group/ExcelTemplate
Robert Graff -