Author image Peter Karman
and 1 contributors


CatalystX::CRUD::View::Excel - view CRUD search/list results in Excel format


 package MyApp::View::Excel;
 use base qw( CatalystX::CRUD::View::Excel );
    etp_config => {
        INCLUDE_PATH => [ 'my/tt/path', __PACKAGE__->path_to('root') ],


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.

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.



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.

template_exists( path )

Search the TT include path to see if path really exists.

get_template_filename( context )

Overrides base method to change the default naming convention. If template is not set in stash(), then the default template path is:

 $c->action . '.xls.' . $self->config->{TEMPLATE_EXTENSION}

TEMPLATE_EXTENSION by default is tt. You can alter that with the config() method.

get_filename( context )

Returns the name of the file to return in the response header Content-Disposition.

results_template( context )

Returns results-specific template.


Peter Karman, <karman at cpan dot org>


Please report any bugs or feature requests to bug-catalystx-crud-view-excel at, or through the web interface at I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.


You can find documentation for this module with the perldoc command.

    perldoc CatalystX::CRUD::View::Excel

You can also look for information at:


The Minnesota Supercomputing Institute sponsored the development of this software.


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