Run the following application:
SendAsJson.zip
Note that you will need to reference the Kendo.Mvc.dll and the Spreadsheet dlls
Open the above file in the Spreadsheet widget on the page;
After the file has been loaded, click the button below the Spreadsheet to send and save the file on the server;
The File/MemoryStream saving logic will throw an error.
Here is what has been discovered while troubleshooting this issue:
The saving will throw errors on the named ranges and wrong references in the xlsx file. After removing them the saving takes very long time (30 min) and errors again.
The original file could be saved using only the Telerik Spreadprocessing implementation as following:
string filePath = Server.MapPath("~/App_Data/FLVJ-v3.xlsx");
if (!System.IO.File.Exists(filePath))
{
throw new FileNotFoundException(String.Format("File {0} was not found!", filePath));
}
Telerik.Windows.Documents.Spreadsheet.Model.Workbook workbook;
IWorkbookFormatProvider formatProvider = new Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXml.Xlsx.XlsxFormatProvider();
using (Stream input = new FileStream(filePath, FileMode.Open))
{
workbook = formatProvider.Import(input);
using (MemoryStream memoryStream = new MemoryStream())
{
formatProvider.Export(workbook, memoryStream);
using (FileStream fileStream = new FileStream(Server.MapPath("~/App_Data/test.xlsx"), FileMode.Create))
{
memoryStream.WriteTo(fileStream);
}
}
}
- I have also tried many different approaches. Removing the first sheet entirely resolves the issue. Reducing the number of rows and columns and removing all formulas also resolves the issue. Removing only the formulas or only reducing the rows/columns results in the long saving and the error at the end.
### Expected/desired behavior
The file should be saved to Memory/FileStream properly.
### Environment
* **Kendo UI version:** 2019.3.1023
* **Browser:** [all]
SendAsJson_updated.zip
Bug report
Workbook.Save() does not save the below file: https://supportheroes.telerik.com/clientsfiles/6bc8932a-4fae-43c1-b745-e1fe2b2f6493_flvj-v3.zip
Reproduction of the problem
Here is what has been discovered while troubleshooting this issue:
Telerik.Windows.Documents.Spreadsheet.Model.Workbook workbook; IWorkbookFormatProvider formatProvider = new Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXml.Xlsx.XlsxFormatProvider();
using (Stream input = new FileStream(filePath, FileMode.Open)) { workbook = formatProvider.Import(input);
}