ERPNext Conference 2019* ERPNext.com Blog

Unable to Export to Excel

excel

#1

Hey everybody!

We just updated to the latest version and since then, we have been unable to export any report to excel. We keep getting an error, please let me know what we would be able to do to resolve this issue.

Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/app.py”, line 61, in application
response = frappe.handler.handle()
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 21, in handle
data = execute_cmd(cmd)
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 56, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 1036, in call
return fn(*args, **newargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/desk/query_report.py”, line 310, in export_query
include_indentation = data[“include_indentation”]
KeyError: u’include_indentation’

I appreciate all the help and great work you guys do with ERPnext!

Thank you!


#2

Not able to replicate this while exporting reports in the current version. (With “Include indentation” enabled/disabled)

Version details:

Screenshot 2019-08-08 11.37.09

Can you share version details and report that you tried to export?


#3

Hi!

Thank you for trying to solve this.

I have versions:

  • ERPNext 11.1.20
  • Frappe 11.1.48

We mainly use this query reports, they are just a simple report to show the current inventory in our warehouses.

SELECT
sletab.item_code as “Codigo::50”,
itemtab.item_name as “Nombre::425”,
sletab.warehouse as “Tienda::200”,
SUM(sletab.actual_qty) as “Qty::80”,
price.price_list_rate as “Precio de Venta::80”

FROM
(SELECT * FROM tabBin ORDER BY creation DESC) as sletab

INNER JOIN
tabItem as itemtab ON sletab.item_code = itemtab.item_code
INNER JOIN
tabItem Price as price ON sletab.item_code = price.item_code

WHERE
sletab.warehouse = “Oficina Central - TYPFS”

GROUP BY
sletab.item_code, sletab.warehouse;

We had been updating frequently, but did not encounter any problems until we did the move to version-11.

I was looking at the gif image you uploaded, but we do not have the “Include Indentation” option available on our export dialog. Based on that, we attempted to update again, but we are showing the latest version when we attempt to do so.

Thank you again for all your help!

EDIT: We tried to export the report as CSV and that worked. We also tried exporting as PDF and it worked, I guess the issue is just with exporting as Excel.


#4

I have this problem too and it occurred after moving to version-11
ERPNext: v11.1.42 (master)
Frappe Framework: v11.1.49 (version-11)

It has occurred in every report I’ve tried to export to Excel. Exporting to CSV and as PDF both work as expected.


#5

This happened to me too after going to 11.
Anybody found a reason or fix yet?

This is the tail of my log:

…apps/frappe/frappe/desk/query_report.py", line 310, in export_query
include_indentation = data[“include_indentation”]
KeyError: u’include_indentation’

Any help here would be appreciated - we depend on Excel exports.

Thanks


#6

This might be a clue…

If I look at the post above by @Jai_Chavan where he suggests inability to replicate, it seems he has an option to include indentation when “Excel” is selected.

This is not the case for me.
When I select “CSV” I get an tick option box “With Group Indentation”

When I select Excel, no option tick box is shown.

image


#7

Hey,

I was able to resolve the issue following this steps:

Once I changed the git configuration I was able to properly update to v11 which resolved the issue with not being able to export to Excel files.

It also gave the option for the indentation select box, which was apparently added on v11 and that is why they were unable to replicate our issues, we were mistakenly thinking we had upgraded to v11, when infact, had not.


#8

Thank you @sonyvec

The problem was a bit different for me, but with the same effect, We did update but there was a glitch causing some files not to update, one of which ended up being the one with the indent switch.

After checking and noticing some other weirdness, I did a full reset from repo which solved the niggles.

Thanks again for replying!