{% extends 'base.html' %} {% load static %} {% block title %}Report Execution Details - Hospital Management{% endblock %} {% block content %}
Execution Status
{% if execution.status == 'running' %} {% elif execution.status == 'failed' %} {% endif %}
{% if execution.status == 'completed' %} Completed Successfully {% elif execution.status == 'running' %} Running {% elif execution.status == 'failed' %} Failed {% elif execution.status == 'cancelled' %} Cancelled {% else %} Pending {% endif %}
{% if execution.status == 'running' %}
{{ execution.progress_percentage|default:0 }}%
{% endif %} {% if execution.completed_at %} {% endif %}
Execution ID: {{ execution.id }}
Started At: {{ execution.started_at|date:"M d, Y H:i:s" }}
Completed At: {{ execution.completed_at|date:"M d, Y H:i:s" }}
Duration: {% if execution.duration %} {{ execution.duration }} {% elif execution.status == 'running' %} Calculating... {% else %} N/A {% endif %}
Executed By: {{ execution.executed_by.get_full_name|default:execution.executed_by.username }}
Execution Metrics
{{ execution.record_count|default:"0"|floatformat:0 }}
Records Processed
{{ execution.file_size|filesizeformat|default:"N/A" }}
Output Size
{% if execution.error_message %}
Error Details

{{ execution.error_message }}

{% endif %}
Report Information
{{ execution.report.name }}
{% if execution.report.description %}

{{ execution.report.description }}

{% endif %}
Report Type: {{ execution.report.get_report_type_display }}
Category: {{ execution.report.get_category_display }}
Output Format: {{ execution.output_format|upper }}
Data Source: {{ execution.report.data_source.name }}
Created By: {{ execution.report.created_by.get_full_name|default:execution.report.created_by.username }}
Created At: {{ execution.report.created_at|date:"M d, Y" }}
Last Modified: {{ execution.report.updated_at|date:"M d, Y" }}
Is Active: {% if execution.report.is_active %} Active {% else %} Inactive {% endif %}
Execution Parameters
{% if execution.parameters %}
{% for key, value in execution.parameters.items %}
{{ key|title }}: {{ value }}
{% endfor %}
{% else %}

No parameters specified for this execution.

{% endif %}
Quick Actions
{% if execution.status == 'completed' %} {% endif %}
Execution Timeline
Execution Started

Report execution initiated by {{ execution.executed_by.get_full_name|default:execution.executed_by.username }}

{{ execution.started_at|date:"M d, Y H:i:s" }}
{% if execution.status != 'pending' %}
Data Processing

Processing data from {{ execution.report.data_source.name }}

{{ execution.started_at|date:"M d, Y H:i:s" }}
{% endif %} {% if execution.status == 'completed' %}
Execution Completed

Report generated successfully with {{ execution.record_count|default:"0" }} records

{{ execution.completed_at|date:"M d, Y H:i:s" }}
{% elif execution.status == 'failed' %}
Execution Failed

{{ execution.error_message|default:"An error occurred during execution" }}

{{ execution.completed_at|date:"M d, Y H:i:s"|default:"N/A" }}
{% elif execution.status == 'cancelled' %}
Execution Cancelled

Report execution was cancelled by user

{{ execution.completed_at|date:"M d, Y H:i:s"|default:"N/A" }}
{% endif %}
{% endblock %}