Performance on spreadjs

Posted by: ffrey on 10 September 2020, 4:47 am EST

  • Posted 10 September 2020, 4:47 am EST

    Hi,
    I'm using GC spreadjs for client side and Documents for Excel for back-end, with this I'm using the spreadsheet.fromJSON() method for loading the workbook. As we progress, we are now doing some research for improving performance, mostly related with loading time for large workbooks.

    One idea could be to implement "paging" for each sheet, this is to have calcs on back-end and then in some way load data per each page. Do you have any thoughts in terms of how can be implemented and if possible?

    Also, do you have some extra tips about what to do for improving performance?

    thanks in advance,
    Fernando
  • Marked as Answer

    Replied 14 September 2020, 10:14 pm EST

    Hi Fernando,

    We are sorry but we could not have formula calculations on the back end. SpreadJS is purely client-side control and all is its functionality is executed only on the client machine.
    However you could implement paging with spreadJS do, what you need to do is set the data using setDataSource() method to load the first change, and then to change the page, load the new data from the server and then again use the setDataSource() method to load the new data. Thus implementing a simple paging mechanism. Please note that using this method, users won't be able to use the data from the other pages in their formulas because spreadJS works only on the client-side, and this data is not loaded yet on the client machine.
    Further, for improving load performance, you could set doNotRecalculateAfterLoad flag to true.
    https://www.grapecity.com/spreadjs/docs/v13/online/SpreadJS~GC.Spread.Sheets.Workbook~fromJSON.html

    Regards
  • Replied 15 September 2020, 4:58 am EST

    Thank you for the quick response! I'll give the doNotRecalculateAfterLoad flag a try.
    Regarding the fromJson, does it make sense to do something like this?

    sp.suspendPaint();
    sp.suspendEvent();
    sp.suspendCalcService(false);

    sp.fromJSON(JSON.parse(data), { doNotRecalculateAfterLoad: true });
    sp.resumeCalcService(false);
    sp.resumeEvent();
    sp.resumePaint();

    or the suspend/resume is unnecessary?

    -

    sharad.tomer said:
    Hi Fernando,

    We are sorry but we could not have formula calculations on the back end. SpreadJS is purely client-side control and all is its functionality is executed only on the client machine.
    However you could implement paging with spreadJS do, what you need to do is set the data using setDataSource() method to load the first change, and then to change the page, load the new data from the server and then again use the setDataSource() method to load the new data. Thus implementing a simple paging mechanism. Please note that using this method, users won't be able to use the data from the other pages in their formulas because spreadJS works only on the client-side, and this data is not loaded yet on the client machine.
    Further, for improving load performance, you could set doNotRecalculateAfterLoad flag to true.
    https://www.grapecity.com/spreadjs/docs/v13/online/SpreadJS~GC.Spread.Sheets.Workbook~fromJSON.html

    Regards
  • Replied 15 September 2020, 7:00 pm EST

    You do not need to call the suspend/resume method when using the fromJSON, SpreadJS internally call these methods during the fromJSON so you may skip these.
Need extra support?

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

Learn More

Forum Channels