Load SpreadJS using nodeJS

Posted by: asaurabh077 on 19 September 2018, 9:42 pm EST

  • Posted 19 September 2018, 9:42 pm EST

    I am trying to load SpreadJS using nodeJS and mock-browser on command prompt. I got [this][/https://www.grapecity.com/en/blogs/how-to-generate-excel-spreadsheets-in-nodejs] but its giving me error (Please refer attached screen shot). You can find more details on my [stackoverflow][https://stackoverflow.com/questions/52399963/load-spreadjs-using-nodejs] question. Please let me know if you need more information or code. We are SpreaJS licencee.

    Your help will be highly appreciated.

    Saurabh
    Virtua Research
  • Replied 19 September 2018, 9:43 pm EST

  • Replied 26 September 2018, 11:09 pm EST

    Hello,

    You can download the sample application which seems to be working fine at my end. Please make sure to to add all the pre-requisites before running the application.


    Thanks,
    Deepak Sharma
  • Replied 26 September 2018, 11:28 pm EST

    Here is the attachment.
  • Replied 26 September 2018, 11:29 pm EST

    SpreadSheetsNodeJSApp.zip
  • Replied 27 September 2018, 5:12 pm EST

    Did you try the same on windows?? I think it does not work properly on windows as it has some issues with Canvas.

    And sadly in [spreadJS][/https://www.grapecity.com/en/download/spreadjs] tutorial you have not mentioned anywhere we do need to install canvas/canvas-prebuilt.
  • Marked as Answer

    Replied 1 October 2018, 12:53 am EST

    Hello,

    I tested the project on Windows machine only. Could you please let me know are you not able to run the project I sent in my last response? What error message are you getting related to 'canvas-prebuilt'?
    Please provide me your application to test further for Windows OS.

    Thanks,
    Deepak Sharma
  • Replied 7 March 2019, 1:56 am EST

    hi I am running into a similar issue.

    TypeError: Cannot read property 'do' of undefined
    at ma.cq (/home/kpatel/tmail/TrunkB/server/services/njs/node_modules/@grapecity/spread-sheets/dist/gc.spread.sheets.all.min.js:29:11295)
    at xa.ow (/home/kpatel/tmail/TrunkB/server/services/njs/node_modules/@grapecity/spread-sheets/dist/gc.spread.sheets.all.min.js:34:14912)
    at xa.sw (/home/kpatel/tmail/TrunkB/server/services/njs/node_modules/@grapecity/spread-sheets/dist/gc.spread.sheets.all.min.js:34:16509)
    at xa.fromJSON (/home/kpatel/tmail/TrunkB/server/services/njs/node_modules/@grapecity/spread-sheets/dist/gc.spread.sheets.all.min.js:41:15172)
    at exports.convert (/home/kpatel/tmail/TrunkB/server/services/njs/api/controllers/spreadJsController.js:40:8)
    at Layer.handle [as handle_request] (/home/kpatel/tmail/TrunkB/server/services/njs/node_modules/express/lib/router/layer.js:95:5)
    at next (/home/kpatel/tmail/TrunkB/server/services/njs/node_modules/express/lib/router/route.js:137:13)
    at Route.dispatch (/home/kpatel/tmail/TrunkB/server/services/njs/node_modules/express/lib/router/route.js:112:3)
    at Layer.handle [as handle_request] (/home/kpatel/tmail/TrunkB/server/services/njs/node_modules/express/lib/router/layer.js:95:5)
    at /home/kpatel/tmail/TrunkB/server/services/njs/node_modules/express/lib/router/index.js:281:22


    I tried downloading this zip you attached and when I run it on my Ubuntu18 box I get nothing after this line. I tried putting console.log after the fromJSON but nothing happens
            wb.fromJSON(data);
    console.log(data);


    kpatel@kpatel-laptop:~/Desktop/SpreadSheetsNodeJSApp/SpreadSheetsNodeJSApp$ node app.js

    ** Using Spreadjs Version "^11.2.1" **

    Manipulating Spreadsheet
    ---




    To debug I added

    , function (e) {
    // process error
    console.log(e);
    }

    to excelIO.open and now I am getting


    ** Using Spreadjs Version "11.2.1" **

    Manipulating Spreadsheet
    ---
    { errorCode: 1, errorMessage: 'Incorrect file format.' }
  • Replied 8 March 2019, 12:35 am EST

    Hello,

    Please make sure that all the referenced Spread.Sheets are loaded.
    Go through the steps mentioned in the blog here:
    https://www.grapecity.com/en/blogs/how-to-generate-excel-spreadsheets-in-nodejs

    Please let me know in case the issue still exists.

    Thanks,
    Deepak Sharma
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels