@treeio_login_required
@handle_response_format
def report_view(request, response_format='html', report_id=None):
 report = get_object_or_404(Report, pk=report_id)
 report_context = _get_report_content(report, request)
 context = _get_default_context(request)
 context.update(report_context)
 if (response_format == 'csv'):
  return render_to_response('reports/gen', context, context_instance=RequestContext(request), response_format='csv')
 report_content = str(render_to_response('reports/gen', context, context_instance=RequestContext(request), response_format='html')).replace('Content-Type: text/html', '')
 charts = report.chart_set.filter(trash=False)
 context = _get_default_context(request)
 context.update({'report': report, 'charts': charts, 'report_content': report_content})
 return render_to_response('reports/report_view', context, context_instance=RequestContext(request), response_format=response_format)

@ treeio_login_required @ handle_response_format def report_view ( request , response_format = 'html' , report_id = None ) : report = get_object_or_404 ( Report , pk = report_id ) report_context = _get_report_content ( report , request ) context = _get_default_context ( request ) context . update ( report_context ) if ( response_format == 'csv' ) : return render_to_response ( 'reports/gen' , context , context_instance = RequestContext ( request ) , response_format = 'csv' ) report_content = str ( render_to_response ( 'reports/gen' , context , context_instance = RequestContext ( request ) , response_format = 'html' ) ) . replace ( 'Content-Type: text/html' , '' ) charts = report . chart_set . filter ( trash = False ) context = _get_default_context ( request ) context . update ( { 'report' : report , 'charts' : charts , 'report_content' : report_content } ) return render_to_response ( 'reports/report_view' , context , context_instance = RequestContext ( request ) , response_format = response_format )
display the report .