Error in export custom report to Excel

Hello, when I try to export a custom report in Excel format I get the following error:

Traceback (most recent call last):
  File "/home/erp/erpnext/apps/frappe/frappe/app.py", line 62, in application
    response = frappe.handler.handle()
  File "/home/erp/erpnext/apps/frappe/frappe/handler.py", line 22, in handle
    data = execute_cmd(cmd)
  File "/home/erp/erpnext/apps/frappe/frappe/handler.py", line 53, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
  File "/home/erp/erpnext/apps/frappe/frappe/__init__.py", line 939, in call
    return fn(*args, **newargs)
  File "/home/erp/erpnext/apps/frappe/frappe/desk/query_report.py", line 161, in export_query
    row_list.append(row.get(columns[idx]["fieldname"],""))
AttributeError: 'list' object has no attribute 'get'

If I select CSV the report exports without errors.

Any ideas?

Thanks!

version? are you using new datatable released in develop branch?

ERPNext: v10.1.14 (master)
Frappe Framework: v10.1.7 (master)

Works fine inv10.1.13

@saurabh6790 can you check if it is on hotfix or master?

I figured out that the problem isn’t present in all the custom reports but one.
The issue was because the report has an empty last row, in CSV it seems that isn’t an issue but in Excel yes.

I have removed the empty row and now works.

Sorry for bother and thanks for the quick response.

1 Like