problem with rendering xlsx report
I am working through an API in Node.js posting requests to a reporting server (also node.js) using jsreport.
Using jsrender engine and html-to-xlsx recipe i am creating xlsx files from data in json format.
The problem is, that sometimes, without any false/corrupted data, I get an error from excel:
"We found a problem with some content in <filename> . Do you want us to recover as much as we can? If you trust the source of this workbook, click Yes"
If I do click Yes, an empty worksheet appears with the following error message:
Excel completed file level validation and repair. Some parts of this workbook may have been repaired or discarded.
Removed Part: /xl/sharedStrings.xml part with XML error. (Strings) A document must contain exactly one root element. Line 1, column 0.
Removed Records: Cell information from /xl/worksheets/sheet1.xml part
This happens occasionally and sometimes the reports export as they should.
When the error occurs, I've tried taking the json file and using it as sample data in jsreport studio and the report comes out fine.
Any ideas? Thanks
Please upload the damaged xlsx file. I will try to unzip it and check its content and hopefully find out what is wrong.
Reviving this thread since the problem seems more consistent now than before.
Link to the corrupted xlsx file: http://www42.zippyshare.com/v/Nczq0VhA/file.html
Bump. I get a similar error, although the file is fine upon opening.
When calling the API it never comes out "correctly", but when using the same data and template in JSreport studio I do not get the error. I put "correctly" in quotes because the file I receive from calling the API is fine after excel "repairs" it. I think the problem is the sharedStrings.xml file in the unzipped Excel file. In my "fixed" version everything is as it should be whereas in the "broken" version the sharedStrings.xml file is basically blank; other than the declaration line:
<sst xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" count="0" uniqueCount="0"/>
Unfortunately the files have work-related data, and so I can not share them. Any ideas on why the sharedStrings.xml is not populating properly?
Also I am using EJS engine rendering xlsx.
Not sure if it is the same issue but I recently had an xlsx corrupt file issue just posting in case anybody else has the same issue
I amusing html to-xlsx recipe with ejs templating, I figured it out that I was missing the <tbody> tag around the table body and adding that fixed it for me