html-xlsx file not opening



  • Hi

    I have successfully created a series of html-xlsx templates on our azure docker based server running v2.10.0. They download and preview perfectly.

    However, when I try creating the same templates on my development instance running locally (v.2.11.0) I get the following error
    "Excel cannot open the file ... because the file format or extension is not valid. etc."

    Even the most simple html example fails to render.

    I have checked that the extension is right and all other settings seem to be the same. The only obvious difference is the version.

    Can anyone advise me on a solution?

    Thanks
    Steve



  • Please try to use the "Download" button from the "Run" button context.
    Does this work? Do you get valid xlsx?

    Please try to preview something with docx recipe. Does this work locally?
    There could be something in the network that breaks the office files.
    The office recipes always need to upload the file to the public server before preview.



  • Hi Jan

    Thanks for the response.

    I get a similar message when downloading the file. The downloaded file seems to be a valid xlsx file but won't open.

    I will try something with the docx recipe and let you know.



  • Don't you have some global script that could modify the response?
    https://jsreport.net/learn/scripts#global-scripts

    Or a custom extension?



  • Hi Jan

    No, my template is as below:

    <table>
    <tr>
    <td>
    Test
    </td>
    </tr>
    </table>

    The only thing I modify is the recipe and then attempt to preview or download and I get the error.

    I tried the docx recipe using the invoice example and it renders fine on my development instance.



  • Hm,
    could you compress your whole application folder, upload it somewhere and share a link?



  • OK, I have managed to resolve the issue by downloading the latest version of JSReport 3.1.1 and testing the same html-to-xlsx template in a new project.

    For some reason, it now works in my original project now. Not sure what the issue could have been, but I am relieved that it works now.

    This didn't turn out to work after restarting the project.

    @jan_blaha , I have mailed you a link to the application folder.



  • Ups, now I remember...

    The html-to-xlsx recipe in jsreport v2, doesn't work with node.js 16.
    You need to either downgrade to node 14, or use jsreport v3.



  • Ah thanks Jan, that makes sense now.

    I will downgrade for now and hopefully that will resolve it.


Log in to reply
 

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.