diff --git a/frappe/public/js/frappe/views/reports/report_view.js b/frappe/public/js/frappe/views/reports/report_view.js index ad4380bb4a..6ac26c00da 100644 --- a/frappe/public/js/frappe/views/reports/report_view.js +++ b/frappe/public/js/frappe/views/reports/report_view.js @@ -1231,23 +1231,27 @@ frappe.views.ReportView = class ReportView extends frappe.views.ListView { action: () => { const args = this.get_args(); const selected_items = this.get_checked_items(true); + let fields = [ + { + fieldtype: 'Select', + label: __('Select File Type'), + fieldname:'file_format_type', + options: ['Excel', 'CSV'], + default: 'Excel' + } + ]; + + if (this.total_count > args.page_length) { + fields.push({ + fieldtype: 'Check', + fieldname: 'export_all_rows', + label: __('Export All {0} rows?', [(this.total_count + "").bold()]) + }); + } const d = new frappe.ui.Dialog({ title: __("Export Report: {0}",[__(this.doctype)]), - fields: [ - { - fieldtype: 'Select', - label: __('Select File Type'), - fieldname:'file_format_type', - options: ['Excel', 'CSV'], - default: 'Excel' - }, - { - fieldtype: 'Check', - fieldname: 'export_all_rows', - label: __('Export All {0} rows?', [(this.total_count + "").bold()]) - } - ], + fields: fields, primary_action_label: __('Download'), primary_action: (data) => { args.cmd = 'frappe.desk.reportview.export_query';