<h2 id="{{ reportId }}" style="color: rgb({{ reportTitleTextColor }}); font-size: {{ reportTitleTextSize }}pt; font-weight:normal;">
    {{ reportName }}
</h2>

{% if reportRows is empty %}
    {{ 'CoreHome_ThereIsNoDataForThisReport'|translate }}
{% else %}
    {% if displayGraph %}
        <img alt=""
                {% if renderImageInline %}
                    src="data:image/png;base64,{{ generatedImageGraph }}"
                {% else %}
                    src="cid:{{ reportId }}"
                {% endif %}
                height="{{ graphHeight }}"
                width="{{ graphWidth }}"/>
    {% endif %}

    {% if displayGraph and displayTable %}
        <br/>
        <br/>
    {% endif %}

    {% if displayTable %}
        <table style="border-collapse:collapse; margin-left: 5px;">
            <thead style="background-color: rgb({{ tableHeaderBgColor }}); color: rgb({{ tableHeaderTextColor }}); font-size: {{ reportTableHeaderTextSize }}pt; text-transform: {{ reportTableHeaderTextTransform }}; line-height:2.5em;">
            {% for columnName in reportColumns %}
                <th style="font-weight: {{ reportTableHeaderTextWeight }}; font-size:10px; text-align:left; padding: 6px 0;">
                    &nbsp;{{ columnName }}&nbsp;&nbsp;
                </th>
            {% endfor %}
            </thead>
            <tbody>
            {% set cycleValues=['','background-color: rgb('~tableBgColor~')'] %}
            {% set cycleIndex=1 %}
            {% for rowId,row in reportRows %}
                {% set rowMetrics=row.columns %}

                {% if reportRowsMetadata[rowId] is defined %}
                    {% set rowMetadata=reportRowsMetadata[rowId].columns %}
                {% else %}
                    {% set rowMetadata=null %}
                {% endif %}
                <tr style="{{ cycle(cycleValues, cycleIndex) }};line-height: 22px;">
                    {% set cycleIndex=cycleIndex+1 %}
                    {% for columnId, columnName in reportColumns %}
                        <td style="font-size: {{ reportTableRowTextSize }}; {% if columnId == 'label' %}border-right: 1px solid rgb({{ tableCellBorderColor }}); {%  else %}border-left: 1px solid rgb({{ tableCellBorderColor }}); {% endif %} padding: 5px 0 5px 5px;">
                            {% if columnId == 'label' %}
                                {% if rowMetrics[columnId] is defined %}
                                    {% if rowMetadata.logo is defined %}
                                        <img src='{{ currentPath }}{{ rowMetadata.logo }}'>
                                        &nbsp;
                                    {% endif %}
                                    {% if rowMetadata.url is defined %}
                                        <a style="color: rgb({{ reportTextColor }});" href='{% if rowMetadata.url|slice(0,4) not in ['http','ftp:'] %}http://{% endif %}{{ rowMetadata.url }}'>
                                    {% endif %}
                                    {{ rowMetrics[columnId] | raw }}{# labels are escaped by SafeDecodeLabel filter in core/API/Response.php #}
                                    {% if rowMetadata.url is defined %}
                                        </a>
                                    {% endif %}
                                {% endif %}
                            {% else %}
                                {% if rowMetrics[columnId] is empty %}
                                    0
                                {% else %}
                                    {{ rowMetrics[columnId] }}
                                {% endif %}
                            {% endif %}
                        </td>
                    {% endfor %}
                </tr>
            {% endfor %}
            </tbody>
        </table>
    {% endif %}
    <br/>
    <a style="text-decoration:none; color: rgb({{ reportTitleTextColor }}); font-size: {{ reportBackToTopTextSize }}pt;" href="#reportTop">
        {{ 'ScheduledReports_TopOfReport'|translate }}
    </a>
{% endif %}
