How does it works the new function saveASJson

I want to save my data in a mysql DB with php (laravel). I do not want to save the xlsx file, only some data received from cells, and some of their attributes.


So I think that the saveAsJson function, can be what i need


Can you explain me if I am right?

Image_9065_1718229658858


I need to do something like this, saving the data, not the file:
https://youtu.be/QxQjp9jgh1M


I really appreciate your help


3 Replies 1 reply marked as answer

BP Babu Periyasamy Syncfusion Team June 13, 2024 02:32 PM UTC

Hi Tomas De arco,

We have reviewed your query about saving the Spreadsheet as JSON data without saving it as an Excel file. To achieve this, you can use our `saveAsJson` method to save the entire Spreadsheet as JSON data. Additionally, you can selectively ignore certain features while saving the Spreadsheet as a JSON object by configuring serialization options and passing them as arguments to the saveAsJson method.

For your convenience, we have prepared a sample. In this sample, we have two buttons: one button saves the entire Spreadsheet and logs the JSON data to the console, and the other button saves the Spreadsheet as JSON with only values by setting `onlyValues` to true in the `saveAsJson` method. Below attached the prepared sample along with the video demonstration for your reference,

Sample link: https://stackblitz.com/edit/ewmybo-i3ldlh?file=index.js

Video link: https://www.syncfusion.com/downloads/support/directtrac/general/ze/SaveAsJson_in_Spreadsheet-1504146328

Kindly, check the above details. If we misunderstood your requirement, please share the below details,

  1. Share the details of how you are loading the data to Spreadsheet. Please share those details along with the code snippet.

  2. Please confirm whether you want the data as the JSON object as we are getting in the saveAsJson method or whether you want the dataSource alone.

  3. If possible, please share the detailed description of your requirement which will be more helpful for us to validate.

Please share the above requested details from your end. Based on that, we will check and provide you the better solution quickly.


Marked as answer

TD Tomas De arco June 13, 2024 05:49 PM UTC

Thanks so much, that's what I need. I appreciate your help.



BP Babu Periyasamy Syncfusion Team June 14, 2024 06:56 AM UTC

Hi Tomas De arco,

We are happy to hear that your problem has been resolved. Kindly get back to us if you need any further assistance.


Loader.
Up arrow icon