I am working on a task, in which I have to download a report in xlsx format. The report file is generated successfully from server, and is received on client side as well.
I encountered a similar problem when writing excel using Javascript library Excel Builder. At the end, I found the reason was that a control character '\u001a' was included in data.
The solution is to encode the control char in Excel's way as '_x001a_'.
The way I diagnosed the problem was like this:
.xlsx file is just a zipped xml file. You can open it with 7-zip. Inside the xl/
folder there is a file sharedString.xml
containing all strings. Extract the file and open it with Notepad++. If you see any control character, then it might be the cause.