CatalystX::CRUD::View::Excel - view CRUD search/list results in Excel format
package MyApp::View::Excel; use base qw( CatalystX::CRUD::View::Excel ); __PACKAGE__->config( TEMPLATE_EXTENSION => 'tt', etp_config => { INCLUDE_PATH => [ 'my/tt/path', __PACKAGE__->path_to('root') ], } ); 1;
CatalystX::CRUD::View::Excel makes it easy to export your search results as an Excel document. If you are using the other CatalystX::CRUD Controller and Model classes, your default end() method might look something like this:
sub end : ActionClass('RenderView') { my ( $self, $c ) = @_; if ( $c->req->param('as_xls') ) { $c->stash->{current_view} = 'Excel'; } }
and get a .xls document for any search or list by simply adding a as_xls=1 param pair to your url query.
as_xls=1
NOTE: If you are paging results, then you will need to turn off paging in order to get all your results in a single .xls file. You can do this with the standard _no_page param as defined in the CatalystX::CRUD::Model API.
_no_page
Overrides base new() method to set default INCLUDE and TEMPLATE_EXTENSION config values.
Overrides base process() method to call get_filename() and create template from results_template if a template file does not exist.
Search the TT include path to see if path really exists.
Overrides base method to change the default naming convention. If template is not set in stash(), then the default template path is:
template
$c->action . '.xls.' . $self->config->{TEMPLATE_EXTENSION}
TEMPLATE_EXTENSION by default is tt. You can alter that with the config() method.
TEMPLATE_EXTENSION
tt
Returns the name of the file to return in the response header Content-Disposition.
Returns results-specific template.
Peter Karman, <karman at cpan dot org>
<karman at cpan dot org>
Please report any bugs or feature requests to bug-catalystx-crud-view-excel at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=CatalystX-CRUD-View-Excel. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-catalystx-crud-view-excel at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc CatalystX::CRUD::View::Excel
You can also look for information at:
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/CatalystX-CRUD-View-Excel
CPAN Ratings
http://cpanratings.perl.org/d/CatalystX-CRUD-View-Excel
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=CatalystX-CRUD-View-Excel
Search CPAN
http://search.cpan.org/dist/CatalystX-CRUD-View-Excel
The Minnesota Supercomputing Institute http://www.msi.umn.edu/ sponsored the development of this software.
http://www.msi.umn.edu/
Copyright 2007 by the Regents of the University of Minnesota.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Catalyst::View::Excel::Template::Plus, CatalystX::CRUD
To install CatalystX::CRUD::View::Excel, copy and paste the appropriate command in to your terminal.
cpanm
cpanm CatalystX::CRUD::View::Excel
CPAN shell
perl -MCPAN -e shell install CatalystX::CRUD::View::Excel
For more information on module installation, please visit the detailed CPAN module installation guide.