How to get current cell text from saveAsJson() method

Hi Team,

Current cell text not getting from saveAsJson() method. But, When I focus on other cell then able to get the last entered text from saveAsJson() response. 

So, How to get current cell data from saveAsJson() response without click on other cell?

Also, Is there any provision to do autosave for spreadsheet component?

3 Replies 1 reply marked as answer

SD Saranya Dhayalan Syncfusion Team August 11, 2020 10:09 AM UTC

Hi Arul Lakshmanan, 
 
Thank you for contacting Syncfusion support 
 
Query: Current cell text not getting from saveAsJson() method. But, When I focus on other cell then able to get the last entered text from saveAsJson() response.  
 
So, How to get current cell data from saveAsJson() response without click on other cell? 
 
We have checked your reported query, we are not able to reproduce it in our end in the latest version. Current cell text getting properly using saveAsJson method.  Please find the below sample link 
 
 
For your convenience we have prepared a video. Please find the video link: 
 
 
Query: Is there any provision to do autosave for spreadsheet component? 
 
Please conform you want to save the data as json after edit the cell. Based on that we will check and provide you a better solution quickly. 
 
Regards, 
Saranya D 



AL Arul Lakshmanan August 28, 2020 05:22 AM UTC

Hello,
I am using the reactJS Spreadsheet.
Is there any method to save spreadsheet data as a file object, so that it will easy for us to upload?

Right now what we are doing is.
Saving spreadsheet data as JSON then trying to convert as a file object then upload to s3

Issue facing - JSON to file object conversion




SD Saranya Dhayalan Syncfusion Team August 31, 2020 01:18 PM UTC

Hi Arul Lakshmanan,  
 
We have checked your reported query, you can achieve this to convert the spreadsheet data to stream. You can convert this stream to file option. Please find the below code snippet: 
 
public string Save([FromBody] SaveSettings saveSettings) 
        { 
            //return Workbook.Save(saveSettings); 
            ExcelEngine excelEngine = new ExcelEngine(); 
            IApplication application = excelEngine.Excel; 
            try 
            { 
                // Convert Spreadsheet data as Stream  
                string basePath = Startup._env.ContentRootPath.ToString() + "/Files/Output.xlsx"; 
                Stream fileStream = Workbook.Save<Stream>(saveSettings); 
                IWorkbook workbook = application.Workbooks.Open(fileStream); 
                var file = System.IO.File.Create(basePath); 
                fileStream.Seek(0, SeekOrigin.Begin);  
                fileStream.CopyTo(file); // to convert the stream to file options 
                file.Dispose(); 
                fileStream.Dispose(); 
                return "Spreadsheet saved in server"; 
            } 
            catch (Exception ex) 
            { 
                return "Failure"; 
            } 
 
        } 
  
For your convenience, we have prepared a sample. Please find the below sample link 
 
 
Please check the above sample and get back to us if you need further assistance on this. 
 
Regards, 
Saranya D 


Marked as answer
Loader.
Up arrow icon