Spreadsheet - ASP.Net Core backend's Save method keeps throwing an error

Hello,

I am using the example Save method for ASP.Net Core projects shown here https://www.syncfusion.com/kb/11970/how-to-open-and-save-an-excel-file-to-server-in-the-spreadsheet

We are using the Spreadsheet component for our Angular project and when we click on the Save Button it should store the content of Spreadsheet component to our file repository located in our server by creating (if there is no such file) or rewrite (if such file exists) the contents of that file.

Unfortunately, when I have added the example method to our ASP.Net core backend project I keep getting the following error:

Failure: System.IO.FileNotFoundException: Could not load file or assembly 'Syncfusion.XlsIORenderer.Portable, Version=18.4140.0.42, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89'. The system cannot find the file specified. File name: 'Syncfusion.XlsIORenderer.Portable, Version=18.4140.0.42, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89' at Syncfusion.EJ2.Spreadsheet.SaveHelper.ExportAsStream() at Syncfusion.EJ2.Spreadsheet.SaveHelper.SaveAsStream() at Syncfusion.EJ2.Spreadsheet.Workbook.Save[T](SaveSettings saveSettings) at DocumentService.Controllers.SpreadsheetController.Save(SaveSettings saveSettings) in

We are running our project in docker container using the Docker Desktop with WLS 2 engine (Ubuntu distro) on Windows 10. Also, we are using the newest versions of both front-end libraries (v. 19.2.47) and backend NuGet packages (v. 19.0.2.47).

Best Regards,

Ignacy Mielniczek


13 Replies

GK Gayathri KarunaiAnandam Syncfusion Team July 19, 2021 03:59 AM UTC

Hi Ignacy, 

We have checked your reported query. We are unable to replicate the reported issue. We have prepared a sample based on your suggestion. Please check the below links. 



Please check the above links and if you are still facing issue, please share the below details. 

  • If possible, please share the video demonstration of the issue.
  • If possible, try to reproduce the reported issue in provided sample or share the issue reproducible sample
  • Please share the Syncfusion version you are using.

Please provide the above requested information, based on that we will check and provide you a better solution quickly. 

Regards, 
Gayathri K 



IM Ignacy Mielniczek July 20, 2021 08:52 AM UTC

Hello Gayathri,

Thanks for a quick response. I am finally able to save excel files to specific directory in our project by downgrading the versions of Spreadsheet component both on front-end and backend sides from 19,2.47 to 18.3.47​. However, unfortunately the following errors are occurring whenever I try to save my changes to our server:

  1. When I have only value of "abcde" in the first row and first column without borders, after saving my output excel file is totally empty.
  2. In a case where I copied an existing table from excel then pasted on Spreadsheet, then when I try to save it to server I get the error:
  3. Failure: System.IndexOutOfRangeException: Index was outside the bounds of the array.
       at Syncfusion.EJ2.Spreadsheet.SaveHelper.processBorder(String Border)
       at Syncfusion.EJ2.Spreadsheet.SaveHelper.UpdateStyles(IMigrantRange migrantRange, SpreadsheetCellStyle style)
       at Syncfusion.EJ2.Spreadsheet.SaveHelper.ProcessSheet(Int32 index)
       at Syncfusion.EJ2.Spreadsheet.SaveHelper.ProcessSheets()
       at Syncfusion.EJ2.Spreadsheet.SaveHelper.InitiateSave()
       at Syncfusion.EJ2.Spreadsheet.SaveHelper.SaveAsStream()
       at Syncfusion.EJ2.Spreadsheet.Workbook.Save[T](SaveSettings saveSettings)
       at DocumentService.Controllers.SpreadsheetController.Save(SaveSettings saveSettings) in ...
  4. In a case where I copied an another existing table from excel and pasted it on Spreadsheet, then when I try to save it to our server I also get the error:
  5. Failure: Newtonsoft.Json.JsonSerializationException: Error converting value "Calibri, sans-serif" to type 'Syncfusion.EJ2.Spreadsheet.FontFamily'. Path 'sheets[0].rows[0].cells[0].style.fontFamily', line 1, position 1535.
     ---> System.ArgumentException: Requested value 'Calibri, sans-serif' was not found.

I can't unfortunately share the specific tables with you because of the data which they contain.

Best Regards,
Ignacy Mielniczek


IM Ignacy Mielniczek July 20, 2021 10:09 AM UTC

Hello again Gayathri,

This time I am uploading a sample excel file with two sample tables in which the tables themselves or their cells borders or values are not being copied and pasted correctly from Excel to Spreadsheet component.

Could you help me by looking at them please? Thank you very much in advance.

Best Regards,

Ignacy Mielniczek


Attachment: Sample_tables_c35ce1a5.rar



AS Aravinthan Seetharaman Syncfusion Team July 22, 2021 03:16 AM UTC

 
We have checked your query. We need to validate more on your query and we need to ensure multiple cases on this. So, we will update further details on 26th July 2021. We appreciate your patience until then. 
 
Regards, 
Aravinthan S 



GK Gayathri KarunaiAnandam Syncfusion Team July 28, 2021 03:53 AM UTC

Hi Ignacy, 

Thanks for the patience. 

We have checked your query. We can reproduce your reported issue in our end. We have logged this as a bug, and it will be available in our upcoming patch release which will be scheduled on August 18th  ,2021 and we appreciate your patience until then. 
 
You can also track the status of this bug by using our feedback portal link below.   
   
 
Please get back to us, if you need further assistance. 
 
Regards, 
Gayathri K 



IM Ignacy Mielniczek August 19, 2021 11:30 AM UTC

Hello Gayathri,


Thanks for the responsI would like to ask you about the upcoming patch release. Has it been already released or is it still on the way?


Best Regards,

Ignacy Mielniczek



GK Gayathri KarunaiAnandam Syncfusion Team August 20, 2021 04:04 AM UTC

Hi Ignacy,   
    
Sorry for the inconvenience caused.    
    
We are facing more complexity on fixing this issue. So, we will include this fix in our next patch release, which will be scheduled on August 25th, 2021. We appreciate your patience until then. You can also track the status of this bug fix using below feedback portal link.     
    
    
Regards,     
Gayathri K 



GK Gayathri KarunaiAnandam Syncfusion Team August 25, 2021 06:35 AM UTC

Hi Ignacy,  

Thanks for the patience. 
  
We are glad to announce that our weekly patch release (19.2.0.57) is rolled out. We have included the fix for your issue [When a data is copied from excel, some values, borders are missing ] in this release. So, we suggest you upgrade our Syncfusion packages to our latest version to resolve this issue in your end. (19.2.0.57
  
  

  
Please let us know, if you need further assistance. 
  
Regards, 
Gayathri K            



IM Ignacy Mielniczek August 27, 2021 08:36 AM UTC

Hello Gayathri,


Thanks for the update. Soon I will check and let you know if everything is working correctly.


Best Regards,

Ignacy Mielniczek



GK Gayathri KarunaiAnandam Syncfusion Team August 30, 2021 05:36 AM UTC

Hi Ignacy Mielniczek, 

Thanks for your update.We will wait to hear from you. 

Regards, 
Gayathri K 



IM Ignacy Mielniczek September 3, 2021 10:58 AM UTC

Hello Gayathri,

Thank you all very much for the good job. Copying the tables from the previous file which I have attached earlier is just working as fine as we wanted.

However unfortunately, I have still the following problems occurring in Spreadsheet v. 19.2.57:


  1. Opening the previous file using the Open function from the Spreadsheet Menu (File -> Open) isn't working properly. It is taking a lot of processing time to open the file but I end up with the tables where some cells are filled in with the values with wrong types. /Spreadsheet error1.png/
  2. Copying the existing table with the colors and formats (e.g. the tables from the file opened above from Point 1.) from Spreadsheet to Microsoft Excel is not working correctly. Sometimes the pasted data is totally empty or when it starts to work then the pasted tables are losing colors and formats. It just happens really rarely that the copied table is pasted correctly with right colors and formats without an error. /Spreadsheet error2.png /
  3. Copying the tables or cells with special characters (superscript, subscript and etc.) from Microsoft Excel to Spreadsheet results the cells losing their formatting. For example: a² (Excel) is pasted as a2 (Spreadsheet).
  4. Opening an existing Excel file results the cells with special characters losing their formatting (as same as in Point 3). Additionally, not all the functions are calculating correctly in Spreadsheet, if one or both of the columns (on which the calculations are being run) cells values are empty like in Microsoft Excel. Instead of showing the values of 0, it shows the error messages. For example: The "MAX" function result when calculated on empty cells.
  5. #801208: Cannot read property 'length' of undefined
  6. Copying the image files from Spreadsheet to Microsoft Excel or backwards from Microsoft Excel to Spreadsheet is not working at all. I have noticed that I am only able to import Images through the following ways:
    1. Using the Insert Image function from the Menu
    2. Opening an existing Excel file with images
    3. Opening the existing Spreadsheet JSON Data with images.
  7. The last problem is regarding the Save method which you have implemented for your Spreadsheet ASP.NET Core service examples. I keep getting the following Unsupported Media Type http error 415 from service (like I mentioned earlier the Open method is working fine): {"type": "https://tools.ietf.org/html/rfc7231#section-6.5.13","title": "Unsupported Media Type","status": 415,"traceId": "|dc7b5ee6-48051b118e45effe."}

I have attached the screenshots and SpreadsheetController.cs with its logs. I hope they might be helpful.

Best regards,
Ignacy Mielniczek


Attachment: Screenshots_and_service_Controller_with_logs_5627f1b.rar



GK Gayathri KarunaiAnandam Syncfusion Team September 6, 2021 03:23 AM UTC

Hi Ignacy, 

We have checked your reported query and attachment. We need to validate more on this. So, we will provide further details on September 7th, 2021. We appreciate your patience until then. 

Regards, 
Gayathri K 



GK Gayathri KarunaiAnandam Syncfusion Team September 15, 2021 02:49 AM UTC

Hi Ignacy, 

We have created an incident for the above queries under your direct trac account, please follow that incident for further assistance. 


Regards, 
Gayathri K 


Loader.
Up arrow icon