ERPNext v14 – Custom Script Report HTML Print Format Not Rendering After Alignment Changes

Hi Team,

I created a custom Script Report for VAT / Tax Summary.
The report is working fine in ERPNext and data is coming correctly with Python code.

But the issue is with Print/PDF format:

I added a custom
HTML/Jinja template (example below).
When I click Print, the output is not showing as expected.

{{ _("Tax Report") }} body { font-family: Arial, sans-serif; font-size: 13px; } .header { text-align: center; font-size: 18px; font-weight: bold; margin-bottom: 10px; } table { width: 100%; border-collapse: collapse; margin-top: 10px; } th, td { border: 1px solid #ccc; padding: 6px; font-size: 12px; } th { background: #f2f2f2; } .totals { font-weight: bold; background: #f9f9f9; }
Tax Report
{{ frappe.utils.formatdate(filters.from_date) }} - {{ frappe.utils.formatdate(filters.to_date) }}
{% for row in data %} {% if row.bold == 2 %} {% elif row.bold == 1 %} {% else %} {% endif %} {% endfor %}
Date Reference Source Type Exclusive Tax Amount Inclusive
{{ row.date }}
{{ row.date }} {{ row.exclusive }} {{ row.tax_amount }} {{ row.inclusive }}
{{ row.date }} {{ row.reference }} {{ row.source_type }} {{ row.exclusive }} {{ row.tax_amount }} {{ row.inclusive }}

My Questions:

Is there a recommended way to design Script Report output in HTML + Jinja?

Environment:

  • ERPNext v14 (Frappe v14)