<%INIT> my $Assets = RTx::AssetTracker::Assets->new($session{CurrentUser}); $Assets->FromSQL($Query); my $DisplayFormat = $Format || RT->Config->Get('DefaultAssetSearchResultFormat'); my @Format = $m->comp('/Elements/CollectionAsTable/ParseFormat', Format => $DisplayFormat); $r->headers_out->set( "Content-Disposition" => "attachment; Content-type=application/vnd.ms-excel; filename=Assets.xls" ); $m->out($Assets->ExportExcel(\@Format)); $m->flush_buffer; $m->abort; <%ARGS> $Query $Format