# Excel File using xlsx writer?

**URL:** https://discuss.tryton.org/t/excel-file-using-xlsx-writer/4218
**Category:** Developer
**Created:** [May 18, 2021, 5:54am UTC](https://discuss.tryton.org/t/excel-file-using-xlsx-writer/4218 "2021-05-18T05:54:36Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![pokoli](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/pokoli/32/22_2.png) [@pokoli](https://discuss.tryton.org/u/pokoli)
#### Post date: [May 18, 2021, 6:21am UTC](https://discuss.tryton.org/t/excel-file-using-xlsx-writer/4218/2 "2021-05-18T06:21:44Z")

</div>

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:

```auto
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!

---

_[View the full topic](https://discuss.tryton.org/t/excel-file-using-xlsx-writer/4218)._
