Save spreadsheet to backend

Posted by: tovarnakm on 30 July 2021, 11:11 am EST

    • Post Options:
    • Link

    Posted 30 July 2021, 11:11 am EST

    Hello,

    what is the most efficient way to dynamically store data from a spreadsheet on backend (onCellChanged, onSheetNameChanged…). At the moment, I use events, but I’m sending the whole spread.toJSON(). However, spread.toJSON() is a relatively large object if my spreadsheet contains multiple sheets and multi-row / multi-column sheets. Is it possible to partially merge / update JSON?

  • Posted 2 August 2021, 6:10 am EST

    Hi Martin,

    This entirely depends on your use case, let’s say your webapp allows users to edit spreadsheet and then save them on the server for later use, in this case, you could add a save button to get the JSON data and save it to the server in one go. If you are worried about the JSON size, then you may export the file to excel and save the excel on the server, further you may also compress the JSON before sending to the server to reduce the size.

    But if you are building more sophisticated system such a realtime collaboration then you need to save the changes in real time, in this case we would recommend you to handle the different event provided by the SJS and corresponding to each event make a server call to inform the server about the event, maintain a copy of SpreadSheet on the server and replicate the same action on the server copy, for example, let’s say user changes value on cell A1 from “test” to “test value”, then on cellEditEnded event you need to inform server than the value A1 is changed to “test value” and then server should update the value of cell A1 in its copy to “test value”.

    To maintain a copy of spreadsheet on server, you may use the “Documents for excel API”. Please refer to the following product page:

    • JAVA: https://www.grapecity.com/documents-api-excel-java

    • .NET: https://www.grapecity.com/documents-api-excel

    Regards

Need extra support?

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

Learn More

Forum Channels