{= # # # # printer_friendly_report # Invoked from client to load a printer friendly report of the given report_job_id # # # include "templates.util.base_util"; include "templates.statistics.util.update_report_job"; include "templates.statistics.build_report_elements"; include "templates.statistics.static_reports.assemble_static_report"; debug_message("\n\n\n#### printer_friendly_report.cfv START \n"); debug_message("\n" . node_as_string("command_line") . "\n\n"); # # # # # Generate the report # # # # string user_node_name = node_name(volatile.authenticated_user_node_path); # Set output language string current_language = get_current_language(user_node_name); set_language(current_language); string profile_name = internal.profile_name; string report_name = command_line.report_name; string current_report_job_id = command_line.report_job_id; string session_id = volatile.session_id; bool is_root_admin = get_is_root_admin(); bool is_access_reports = is_root_admin or get_access_reports_permission(session_id, profile_name); if (is_access_reports) then ( string session_profile_path = "sessions_cache." . session_id . ".profiles." . profile_name; string report_job_id = update_report_job(session_id, profile_name, report_name, current_report_job_id, "static_print"); node report_job = session_profile_path . ".report_jobs." . report_job_id; bool is_ready_report = @report_job{"is_ready_report"}; if (!is_ready_report) then ( # Create the report elements build_report_elements(session_id, profile_name, report_job); ); assemble_static_report(session_id, is_root_admin, profile_name, report_name, report_job_id, "", false, ""); ) else ( # No permission to view this resource (URL) display_no_permission_html(); ); =}