Get saveSettings.JSONData from Spreadsheet control

Sir / Madam.


When saving the SFSpreadsheet and API call is made which contains a 'saveSettings' object. In that object is the field JSONData, which is a JSON representation of the Spreadsheet.

Is there anyway in the SFSpreadsheet to get this JSONData, without having the invoke 'SaveAs'? 


The reason is, my SFSpreadsheet control is running in an Office Dialog box in an OfficeAddin. As such it runs in its own IFrame context, Invoking SaveAs in this environment saves the file, but can not return correctly to the correct context. This is is a limitation of the IFrame context, and not caused by Syncfusion. If I can extract the JSONData, then I can send this as a text stream back to my host context, and it can then invoke the API to save the excel file


James


2 Replies

JA James March 28, 2023 09:12 AM UTC

I do note the saveAsJson() function, it returns a Workbook: Json object. Is this Workbook object the same as what is sent in the SaveAs? Do I need to modify it?



SP Sangeetha Priya Murugan Syncfusion Team March 29, 2023 10:56 AM UTC

Hi James,


Yes, the saveAsJson method returns the same JSON data that we sent to the server side for the SaveAs action. You can use that JSON based on your needs. For more details, please refer to the below links.

https://ej2.syncfusion.com/angular/documentation/api/spreadsheet/#saveasjson


To save/open the excel file in server, please refer the below link.


https://www.syncfusion.com/kb/11970/how-to-open-and-save-an-excel-file-to-server-in-the-spreadsheet


In the above link we have used the openFromJson and saveAsJson client-side methods to open and saving the excel file in server side.


Loader.
Up arrow icon