large JSON data won't load in Spreadsheet

6 posts, 1 answers
  1. Mark
    Mark avatar
    1 posts
    Member since:
    Dec 2015

    Posted 21 Feb Link to this post

    Hi,

    My end goal is create a Telerik.Web.Spreadsheet.Workbook that is loaded from the database server side and load it in the Kendo spreadsheet control on the client side. This was working fine until I got to a certain size file. 

    To simplify I've attached a sample of the JSON of the worksheet that I'm having a problem loading and below is the code. I've checked a couple of sources to verify that the JSON validates. I'm not sure what else could be the problem. If you remove the last few rows (to truncate back to index 198) it loads fine.

    Server side code:

    public ActionResult ReadSheet(string id) {

    string jsonWorksheet = string.Empty;

    using (TextReader reader = System.IO.File.OpenText(@"C:\DemoRowTo204Broken.json")) {     

    jsonWorksheet = reader.ReadToEnd();

    }

    return Content(jsonWorksheet, Telerik.Web.Spreadsheet.MimeTypes.JSON);

    }

    client side code in an .cshtml file:

    @(Html.Kendo().Spreadsheet()     .Name("eSheet")     .Toolbar(false) )<script>           $(document).ready(function () {               var spreadsheet = $("#eSheet").data("kendoSpreadsheet");               $.getJSON("@Url.Action("ReadSheet", "ProductGrid")", { id: $("#ProductID").val() }, function (data) {                   spreadsheet.fromJSON(data);               })             }); </script>

    Your advise is appreciated. Mark

  2. Answer
    Alex Gyoshev
    Admin
    Alex Gyoshev avatar
    2500 posts

    Posted 24 Feb Link to this post

    Hello Mark,

    By default, the spreadsheet rows are set to 200, and the columns to 50. If you are trying to load more rows, it might be the case that you are hitting this limitation. You can resolve this by increasing the amount of rows that the spreadsheet can show.

    Regards,
    Alex Gyoshev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Kendo UI is VS 2017 Ready
  4. Mickey
    Mickey avatar
    1 posts
    Member since:
    Apr 2015

    Posted 24 May in reply to Alex Gyoshev Link to this post

    Alex,  we're evaluating using the spreadsheet in the Kendo UI and found the 200 row limit in the demo.   Is it possible to bind data and extend the number for rows to display to be in excess of the 200 limit?  We would need to display 1,000 rows as a minimum. 

    Thanks,

    M Lavender

  5. Alex Gyoshev
    Admin
    Alex Gyoshev avatar
    2500 posts

    Posted 26 May Link to this post

    Hello Mickey,

    Yes, use the rows configuration option. Please note that there has been a regression regarding the property in one of the latest releases, so it is advisable that you use the latest internal build, where it works correctly.

    Regards,
    Alex Gyoshev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  6. David
    David avatar
    1 posts
    Member since:
    Sep 2016

    Posted 16 Nov in reply to Mark Link to this post

    Hi Mark

     

    Did you manage to figure out how to do this? I am doing pretty much the same as you and cant seem to figure out how to set the maximum rows to more than 200.

     

    Regards 

    David

  7. T. Tsonev
    Admin
    T. Tsonev avatar
    2770 posts

    Posted 18 Nov Link to this post

    Hi,

    The fromJSON method on the Spreadsheet will set the sheet size automatically.
    Note that the fromJSON method on individual sheets will not do that, as sheet size is fixed once initialized.

    If you'd like to load data into existing sheets make sure you set the rows and columns properties to the maximum value you anticipate to encounter.

    The memory usage is not linear and a spreadsheet with 1e7 cells will use just a little bit more memory than a sheet with 1e3 cells.
    That is, until you start filling them with data.

    Regards,
    T. Tsonev
    Telerik by Progress
    Kendo UI is ready for Visual Studio 2017 RC! Learn more.
Back to Top
Kendo UI is VS 2017 Ready