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?


  • 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?

    Or a custom extension?

  • Hi Jan

    No, my template is as below:


    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.

  • @jan_blaha could you solve the problem with node v16 or is necesary to use in v14?

  • I am afraid you need to use node 14 with jsreport v2 in order to have excel working.

    The jsreport v3 should ve used with the latest LTS.

  • Excel cannot open the file ****.xlsx because the file format or file extension is not valid. Verify that the file has not been corrupted and that the file extension matches the format of the file.

Log in to reply

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