Trying to save template with xlsx recipe in MSSQL.

  • i forgot to mention i copied the template from playground for xlsx table ( and then uploaded a copy of the xlsx template referenced to my server to run this test.

  • It could help if you upload the downloaded/produced excel somewhere for the beginning.

  • I uploaded a zip file with the xlsx template (table.xlsx) and the produced excel (jsreport.xlsx) to the following .

    The template code is below:

    {{#xlsxAdd "xl/worksheets/sheet1.xml" "worksheet.sheetData[0].row"}}
            <c t="inlineStr"><is><t>5</t></is></c>
            <c t="inlineStr"><is><t>6</t></is></c>
    {{#xlsxMerge "xl/tables/table1.xml" "table.autoFilter"}}
        <autoFilter ref="A1:B3"/>
    {{#xlsxMerge "xl/tables/table1.xml" "table"}}
        <table ref="A1:B4"/>

  • The provided excel is really invalid zip file. So far I cannot reproduce it.
    Can you try to provide us more information?

    • does it happen also when using default fs store
    • are you able to open the result in excel when you don't reference template, only with {{{xlsxPrint}}} in content
    • can you try it on different pc or possibly os?
    • whatever it comes to your mind could be helpful to us

    Thank you

  • Tried all that you suggested got the same results, tried this on 2 servers. Did not try another os.

    I have discovered this, the xlsx that is created on the server in the appdata folder is valid, the version that is downloaded is corrupt.

    I have included the 2 versions in a zip file

    The server is running Node v6.10.0

  • I have noticed the xlsx on the server in the appdata folder is encoded as ansi and the one downloaded is utf8.

    Is this something your application choosing different encoding when saving as opposed to downloading, or is this something i need to check into on my system.

    Any ideas?

  • So you confirm that

    • the problem is not related to the mssql store, because you have same issue with fs store
    • the problem is not related to the particular template

    I cannot find an issue in our code. Can you try the download with a different browser? Does this happen also when you download the stream using API call?
    I tried again and really cannot reproduce it.

    The headers I see in F12 tools


    Content-Disposition:inline; filename="report.xlsx"
    Date:Tue, 23 May 2017 14:49:14 GMT
    Set-Cookie:render-complete=true; Path=/


    Accept-Encoding:gzip, deflate, br
    Cookie:session=EvE6LIvpMarDGMC_VwMbWw.8PTgq_6LF6LDqiOtHKXC5nDqHIQmSsY-UQA-dkPMhvIMTqNYZP7AvYGho3_EGxLWKoe2gclxj6PqN-3F9CfPaw.1492679112924.315360000000.8VwR5XvVoZXwLKAPMXrFjr6DA4QEqRsa-PCQqJMsNHI; render-complete=false
    User-Agent:Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36

  • I got it running, sort of. I installed on my dev machine which was running node v4.6.0 everthing worked fine.

    My server was running v6.10.3 which was giving me the issues, i also tried installing v7.10.0 on my server after uninstalling v6.10.3 and was getting same issue.

    I then uninstalled node again and put v4.6.0 on the server, excel downloads correctly.

    What versions of Node are supported?


  • Well all of those. It is working for me with version 6.10.3

  • not sure what problem was, i just upgraded node to 6.10.3 and it is working, i am running, i will try rebuilding my dev machine from ground up and see what happens.

    Thank you for all your help and time, much appreciated!

  • You are welcome. It is a strange problem. If you ever figure out what could be a possible cause please post here, I'll try to replicate it.

  • The same is happening on the jsreport playground: and

    I'm looking into jsreport as an alternate way of producing excel exports but it doesn't seem to work without going through the office online viewer... which isn't really an option for us.

    Any idea what is causing the issue?

  • @jbzcooper What kind of issue do you have actually? There are many things mentioned in this thread.

Log in to reply

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