Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workbook.Save() does not save specific files #5463

Open
veselints opened this issue Dec 4, 2019 · 1 comment
Open

Workbook.Save() does not save specific files #5463

veselints opened this issue Dec 4, 2019 · 1 comment

Comments

@veselints
Copy link
Contributor

veselints commented Dec 4, 2019

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

  • 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]
@mihaela-lukanova
Copy link

Increased priority due to a report in 1590685

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants