Greetings. I am trying to generate an excel file from an existing excel template using the xlsx recipe and handlebars engine. This file is created with no issue in JSREport studio on our server instance. However, when running the same request locally, I get a corrupt file. Specifically, the excel file returned is missing the sharedStrings.xml file.
Excel offers to recover the content and can do so successfully. After doing so, I notice that the sharedStrings.xml file is created. I assume based on this that the lack of this file causes the corruption in the first place.
I can't see any reason why I would be getting an issue locally. This occurs with any version of the JSReport binary. However, it doesn't occur at all on a server. I use the same content and template on both.
I have tried it out on the playground and confirmed that it works. https://playground.jsreport.net/w/anon/H0EjR6M9 The issue seems to only occur locally.
The command I run is ./jsreport.exe render -r "request.json" --template.xlsx.template=$base64String --template.content="content.html" --template.helpers="helpers.js" -o "test.xlsx"
where $base64String is produced by
$base64String = [Convert]::ToBase64String([IO.File]::ReadAllBytes("[FILE_PATH_HERE]"))
The issue occurs even on the most simple content like {{{xlsxPrint}}}
.
Note that while I am posting a CLI example, I am actually generating the report in a .net application, however the exact same thing occurs (corrupt excel file).
Does anyone know why the results between 2 JSreport instances would be different? Could this be related to the missing sharedString.xml file that is removed from the intial .xlsx template? I can provide additional info if needed. Thank you