This is a migrated thread and some comments may be shown as answers.

large JSON data won't load in Spreadsheet

5 Answers 701 Views
Spreadsheet
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 22 Feb 2016, 01:53 AM

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

5 Answers, 1 is accepted

Sort by
0
Accepted
Alex Gyoshev
Telerik team
answered on 24 Feb 2016, 08:53 AM

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!
 
0
Mickey
Top achievements
Rank 1
answered on 24 May 2016, 04:06 PM

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

0
Alex Gyoshev
Telerik team
answered on 26 May 2016, 07:24 AM

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!
 
0
David
Top achievements
Rank 1
answered on 16 Nov 2016, 06:15 AM

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

0
T. Tsonev
Telerik team
answered on 18 Nov 2016, 08:49 AM
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.
Tags
Spreadsheet
Asked by
Mark
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Mickey
Top achievements
Rank 1
David
Top achievements
Rank 1
T. Tsonev
Telerik team
Share this question
or