fix(Reports): don't export hidden columns in reports

This commit is contained in:
prssanna 2020-04-18 21:20:45 +05:30
parent bd16804a95
commit e2eea4447b
2 changed files with 6 additions and 1 deletions

View file

@ -299,6 +299,7 @@ def export_query():
_("You can try changing the filters of your report."))
return
data.columns = [col for col in data.columns if not col.get('hidden')]
columns = get_columns_dict(data.columns)
from frappe.utils.xlsxutils import make_xlsx

View file

@ -1084,7 +1084,11 @@ frappe.views.QueryReport = class QueryReport extends frappe.views.BaseList {
], ({ file_format, include_indentation }) => {
this.make_access_log('Export', file_format);
if (file_format === 'CSV') {
const column_row = this.columns.map(col => col.label);
const column_row = this.columns.map(col => {
if (!col.hidden) {
return col.label;
}
});
const data = this.get_data_for_csv(include_indentation);
const out = [column_row].concat(data);