← Builder
{{ report.title }} {{ name }}

{{ report.title }}

Schema: {{ name }} Generated: {{ generated_at }}

{% for block in blocks %}
{% if block.type == 'text' %}
{{ block.content | md_to_html | safe }}
{% elif block.type == 'query' %} {% set dm = block.display_mode or 'table' %}
{% if dm == 'chart' %} {% elif dm == 'both' %} {% else %} {% endif %} {{ block.title }}
{% if block.error %}
{{ block.error }}
{% elif not block.columns %}
No data returned.
{% else %} {% if block.truncated %}
⚠ Results limited to 500 rows
{% endif %} {# ── Table view (shown for 'table' and 'both') ─────────────────── #} {% if dm == 'table' or dm == 'both' %}
{{ block.rows|length }} row{{ 's' if block.rows|length != 1 else '' }}, {{ block.columns|length }} column{{ 's' if block.columns|length != 1 else '' }}
{% for col in block.columns %}{% endfor %} {% for row in block.rows %} {% for cell in row %} {% if cell is none %} {% else %} {% endif %} {% endfor %} {% endfor %}
{{ col }}
null{{ cell | string | truncate(80) }}
{% endif %} {# ── Chart view (shown for 'chart' and 'both') ────────────────── #} {% if dm == 'chart' or dm == 'both' %} {% if not block.group_by_col %}
⚠ No Group by column configured - open the report builder and set a Group by column for this chart.
{% else %}
{{ block.agg_func }}{% if block.agg_col %}({{ block.agg_col }}){% else %}(*){% endif %} grouped by {{ block.group_by_col }}
{% endif %} {% endif %} {% endif %}{# end error/no-data #} {% endif %}{# end block.type #}
{% endfor %} {% if not blocks %}
This report has no blocks yet. Open the builder to add content.
{% endif %}