MojoX::Renderer::WriteExcel - emit Excel spreadsheets from Mojo
use MojoX::Renderer::WriteExcel; sub startup { my $self = shift; $self->types->type(xls => 'application/vnd.ms-excel'); my $self->renderer->add_handler( xls => MojoX::Renderer::WriteExcel->new ); }
NOTE: This module is deprecated. Please use Mojolicious::Plugin::WriteExcel module version 2 instead.
This renderer converts the result element in the stash to an Excel spreadsheet. If the stash also has a heading element, the renderer will also write headings in bold type for the columns in the spreadsheet.
result
heading
heading is an arrayref, while result is an array of arrayrefs.
Optionally, a settings parameter can be provided to set additional attributes in the Excel spreadsheet. Currently 'column_width' is the only working attribute. settings is a hashref. Column widths could be set by passing the settings to render such as:
settings
settings => {column_width => {'A:A' => 10, 'B:B' => 25, 'C:D' => 40}}
This method returns a handler for the Mojo renderer.
Zak B. Elep <zakame@cpan.org>
Please report any bugs or feature requests to bug-mojox-renderer-writeexcel at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=MojoX-Renderer-WriteExcel. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-mojox-renderer-writeexcel at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc MojoX::Renderer::WriteExcel
You can also look for information at:
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=MojoX-Renderer-WriteExcel
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/MojoX-Renderer-WriteExcel
CPAN Ratings
http://cpanratings.perl.org/d/MojoX-Renderer-WriteExcel
Search CPAN
http://search.cpan.org/dist/MojoX-Renderer-WriteExcel/
Thanks to Graham Barr and his MojoX::Renderer::YAML module, and Sebastian Riedel's core Mojolicious::Plugin::EpRenderer for showing how to write renderers for Mojo!
Inspiration for this renderer came from this mailing list thread: http://archives.free.net.ph/thread/20100625.092704.ed777265.en.html
Copyright 2010 Zak B. Elep.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
To install MojoX::Renderer::WriteExcel, copy and paste the appropriate command in to your terminal.
cpanm
cpanm MojoX::Renderer::WriteExcel
CPAN shell
perl -MCPAN -e shell install MojoX::Renderer::WriteExcel
For more information on module installation, please visit the detailed CPAN module installation guide.