Save a spreadsheet without SaveUrl="" property

Hi,

How to save a spreadsheet without API url . And also how to retrive data in JSON format from spreadsheet after editing it.

when I gave 

 this.spreadsheet.saveAsJson().then(Json => {
      console.log(Json.jsonObject.Workbook.sheets[0].rows)})

Json.jsonObject.Workbook.sheets[0].rows gives me below format 

[

    {

        "cells":[

            {

                "value":"Rate Card Country"

            },

            {

                "value":"Role"

            },

            {

                "value":"Level"

            },

            {

                "value":"Rate Card Type"

            },

            {

                "value":"Start Date"

            },

            {

                "value":"End Date"

            },

            {

                "value":"Unit"

            },

            {

                "value":"Rate Card Currency"

            },

            {

                "value":"Rate"

            }

        ]

    },

    {

        "cells":[

            {

                "value":"USA"

            },

            {

                "value":"Business Analyst"

            },

            {

                "value":"9"

            },

            {

                "value":"Standard"

            },

            {

                "value":"44197",

                "format":"mm-dd-yyyy"

            },

            {

                "value":"44533",

                "format":"mm-dd-yyyy"

            },

            {

                "value":"Hour"

            },

            {

                "value":"USD"

            },

            {

                "value":"25"

            }

        ]

    }

]

How to get this data as a JSON

Thanks,

Kalaiselvan V


1 Reply

SP Sangeetha Priya Murugan Syncfusion Team June 28, 2022 11:43 AM UTC

Hi Kalai,


Query #1: How to save a spreadsheet without API url


Currently, we don’t have support for client side excel exporting in spreadsheet. However, we have considered this as a feature, and it will be available in any of our upcoming releases. You can track the status of this feature using below link from our feedback portal, 


Feedback Portal Link: https://www.syncfusion.com/feedback/18431/need-to-provide-support-for-client-side-importing-in-spreadsheet


Query #2: To get JSON data


Your requirement can be achievable in our spreadsheet by using the getData method. For more details, please refer the below link.


API Link: https://ej2.syncfusion.com/react/documentation/api/spreadsheet#getdata


For your convenience, we have prepared the sample based on our suggestion. In this we have print modified spreadsheet data as JSON in console window in an external button click event. Please find the link below.


Sample Link: https://stackblitz.com/edit/react-j3ab9e-ww36cx?file=index.js


Could you please check the above details and get back to us, if you need any further assistance on this.


Regards,

Sangeetha M



Loader.
Up arrow icon