From b47b9ef5a84b308d3334dd16024b0df92c0c3f8f Mon Sep 17 00:00:00 2001 From: Sun Howwrongbum Date: Mon, 7 Oct 2019 11:12:42 +0530 Subject: [PATCH] fix: pdf report js issues (#8554) * fix: pdf report js issues * fix: template being set to null --- frappe/public/js/frappe/views/reports/query_report.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/frappe/public/js/frappe/views/reports/query_report.js b/frappe/public/js/frappe/views/reports/query_report.js index 51845a10dc..4bfa791403 100644 --- a/frappe/public/js/frappe/views/reports/query_report.js +++ b/frappe/public/js/frappe/views/reports/query_report.js @@ -859,17 +859,20 @@ frappe.views.QueryReport = class QueryReport extends frappe.views.BaseList { const landscape = print_settings.orientation == 'Landscape'; const custom_format = this.report_settings.html_format || null; + const columns = this.get_columns_for_print(print_settings, custom_format); const data = this.get_data_for_print(); const applied_filters = this.get_filter_values(); const filters_html = this.get_filters_html_for_print(); - const content = frappe.render_template(print_settings.columns ? 'print_grid' : custom_format, { + const template = + print_settings.columns || !custom_format ? 'print_grid' : custom_format; + const content = frappe.render_template(template, { title: __(this.report_name), subtitle: filters_html, filters: applied_filters, data: data, original_data: this.data, - columns: this.get_columns_for_print(print_settings, custom_format), + columns: columns, report: this });