XLSX file corrupted after download from JSreport using API

  • Hi
    I am working through an API in Node.js posting requests to a jsreport.

    Using jsrender engine and xlsx recipe i am creating xlsx files from data in json format.
    The problem is that , 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

    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.

    for reference i have uploaded the corrupted xlsx file.
    [0_1532000403750_Report (6).xlsx](Uploading 100%)

  • Please try to upload the xlsx file again, it didn't make it through.

    It would be the best if it is a minimal excel file, with one cell is the best :)
    But I guess this is happening just with a complex one.

  • This files is invalid zip. That is strange.
    Are you able to replicate the issue locally?
    Do you have some observations like that this is happening just for particular code?
    Does the same happen also on the latest jsreport?

    So far I have no clue how it could happen that the output zip/xlsx is corrupted.

  • Hi,

    Thanks for replay.

    i have signup the JSreport online and created a simple XLSX template and same has been downloaded using API from ReactJS web application. it is working without any issues.

    if i create the same XLSX template in our local JSreport which was hosted in AWS (installed using Docker) and if i download using API from ReactJS web application. it is corrupting the xlsx, but if i directly download the same from the Portal it is not corrupted.

    Please let us how do we fix this.

  • We are facing the same issue. If I execute jsreport.renderAsync directly from client side the Excel files are downloaded correctly. But if I use node.js server (with Docker) to download the file is corrupted. I still can't provide more infomation, because the colleague that is developing the node.js API has one more day off. The pdf files are working fine. When he is back, if it is not error on his side we will provide corrupted file. But I assume that it won't be, having in mind that we are not the first one facing the problem.

    Best regards,

  • Unable to replicate it. Please try to follow my steps so we can isolate the issue.

    1. Running jsreport docker image
    docker run -p 5488:5488 jsreport/jsreport:2.1.1
    1. Create template test with xlsx recipe and content
    {{#xlsxAdd "xl/worksheets/sheet1.xml" "worksheet.sheetData[0].row"}}
            <c t="inlineStr"><is><t>Hello world</t></is></c>
    1. Create client which remotely render report
    const client = require('jsreport-client')('http://localhost:5488')
    const fs = require('fs')
    async function run() {
        const report = await client.render({ template: { name: 'test' } })

    The output file out.xlsx can be open in the ms excel.

Log in to reply

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