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

Improve toJson() method implementation to prevent from System.OutOfMemoryException for large number of records #4017

Open
mparvanov opened this issue Feb 23, 2018 · 0 comments

Comments

@mparvanov
Copy link
Contributor

mparvanov commented Feb 23, 2018

Description

Improve the toJson() method current implementation which uses Newtonsoft.Json internally to prevent from System.OutOfMemoryException for large number of records

Reproduction of the problem

Create an action method that returns JSON from an excel document with large number of records:

public ActionResult Read()
        {
            var cuastomerPath = Server.MapPath("~/App_Data/AR_Converter.xlsx");
            var workbook = Telerik.Web.Spreadsheet.Workbook.Load(cuastomerPath);

            //Uses Newtonsoft.Json internally to serialize fields correctly.
            return Content(workbook.ToJson(), Telerik.Web.Spreadsheet.MimeTypes.JSON);
        }

Current behavior

Exception of type 'System.OutOfMemoryException' was thrown.

Expected/desired behavior

No errors are thrown

Environment

  • Kendo UI version: 2018.1.221
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

2 participants