Export objects to xlsx - problem

Hello,
If i tried export object to excel to format xlsx i have error:

[2020-05-15 10:53:24][ERROR   ] --- Error handling request /rest/file/object/12/XlsxExportType (glogging.py)
Traceback (most recent call last):
  File "flask/app.py", line 2292, in wsgi_app
  File "flask/app.py", line 1815, in full_dispatch_request
  File "flask_cors/extension.py", line 161, in wrapped_function
  File "flask/app.py", line 1718, in handle_user_exception
  File "flask/_compat.py", line 35, in reraise
  File "flask/app.py", line 1813, in full_dispatch_request
  File "flask/app.py", line 1799, in dispatch_request
  File "cmdb/interface/route_utils.py", line 107, in decorated
  File "cmdb/interface/rest_api/exporter_routes/file_routes.py", line 68, in export_file
  File "cmdb/file_export/file_exporter.py", line 148, in export
  File "cmdb/file_export/export_types.py", line 131, in export
  File "cmdb/file_export/export_types.py", line 171, in create_xls_object
  File "openpyxl/workbook/workbook.py", line 199, in create_sheet
  File "openpyxl/worksheet/worksheet.py", line 101, in __init__
  File "openpyxl/workbook/child.py", line 50, in __init__
  File "openpyxl/workbook/child.py", line 96, in title
ValueError: Invalid character / found in sheet title

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "gunicorn/workers/sync.py", line 135, in handle
  File "gunicorn/workers/sync.py", line 176, in handle_request
  File "cmdb/interface/gunicorn.py", line 131, in __call__
  File "flask/app.py", line 2309, in __call__
  File "flask/app.py", line 2295, in wsgi_app
  File "flask_cors/extension.py", line 161, in wrapped_function
  File "flask/app.py", line 1748, in handle_exception
  File "cmdb/interface/error_handlers.py", line 121, in internal_server_error
AttributeError: 'ValueError' object has no attribute 'description'

and i have a type which name have β€œ/” but i think it not should be a error for export to xlsx. (for other type export works good)

Hi @marcinw

in our Excel export, we use the label of an object type as name of the Excel worksheet. Some characters (like /, *) are not allowed in Excel at this place. We handled that issue in [NET-416] and created a fix, that replaces these characters with an underscore. The fix will be included in the upcoming 1.2 release - or if you can’t wait, just have a look at the version-1.1 branch, which is in fact version 1.1.5 + the fix. Thanks for reporting that issue.

Hi @mbatz
Thank you for fix it. I will wait till 29.05 for 1.2 release.

Hi,
now i can export to xlsx when i have in type character β€œ/”

1 Like