X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fgraph%2Felements%2Freport.html;h=3773fbf1d53c124be3bdb16ef242036077127299;hb=fb4ab1073f0d15d660c6cdc4e07afebf68ef3924;hp=e24c6637d3360fd2791dc2ac16f08fe4fbb3a4e4;hpb=624b2d44625f69d71175c3348cae635d580c890b;p=freeside.git diff --git a/httemplate/graph/elements/report.html b/httemplate/graph/elements/report.html index e24c6637d..3773fbf1d 100644 --- a/httemplate/graph/elements/report.html +++ b/httemplate/graph/elements/report.html @@ -105,11 +105,11 @@ any delimiter and linked from the elements in @data. % $worksheet->write( $r, $c++, shift( @row_labels ) ); % foreach ( @{ shift( @data ) } ) { % $total += $_; -% $bottom_total[$c] += $_; +% $bottom_total[$c-1] += $_; % $worksheet->write($r, $c++, sprintf($sprintf, $_) ); % } % unless ( $opt{'nototal'} ) { -% $bottom_total[$c] += $total; +% $bottom_total[$c-1] += $total; % $worksheet->write($r, $c++, sprintf($sprintf, $total) ); % } % } @@ -155,30 +155,32 @@ any delimiter and linked from the elements in @data. % ); % % http_header('Content-Type' => 'image/png' ); +% http_header('Cache-Control' => 'no-cache' ); % % $chart->_set_colors(); % <% $chart->scalar_png([ $opt{'axis_labels'}, @data ]) %> % % } else { +% # image and download links should use the cached data +% # just directly reference this component +% my $myself = $p.'graph/elements/report.html?session='.$session; % <% include('/elements/header.html', $opt{'title'} ) %> -% $cgi->param('_type', 'png'); +% unless ( $opt{'graph_type'} eq 'none' ) { - +" WIDTH="976" HEIGHT="384"> +% }

% unless ( $opt{'disable_download'} ) { -% $cgi->param('_type', "xls" ); Download full results
- as Excel spreadsheet
-% $cgi->param('_type', 'csv'); - as CSV file

-% $cgi->param('_type', "html" ); + as ">Excel spreadsheet
+ as ">CSV file

% } %

-<% include('/elements/table.html', 'e8e8e8') %> +<% include('/elements/table.html', 'f8f8f8') %> @@ -269,6 +271,16 @@ any delimiter and linked from the elements in @data. <%init> my(%opt) = @_; +my $session; +# load from cache if possible, to avoid recalculating +if ( $cgi->param('session') =~ /^(\d+)$/ ) { + $session = $1; + %opt = %{ $m->cache->get($session) }; +} +else { + $session = sprintf("%10d%6d", time, int(rand(1000000))); + $m->cache->set($session, \%opt, '1h'); +} my $sprintf = $opt{'sprintf'} || '%.2f';