From the traceback the problem is that output is an Integer and can not be converted to bytes.
You should read the value from the stream to get its content. It should be fixed with the following line:
return ('xlsx', output.read(), False, action_report.name)
Having said that if you want to generate Excel files, you can use a ods template with relatorio, and set the extension to xlsx to convert the file to the expected format. Just take care of having libreoffice installed on the server to enable report conversion.
Hope it helps!