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

Exporting large Kendo grid dataset

9 Answers 1107 Views
Grid
This is a migrated thread and some comments may be shown as answers.
PrimePay
Top achievements
Rank 1
PrimePay asked on 23 Sep 2016, 09:39 PM

I found the following section regarding exporting large datasets from the Kendo Grid:

http://docs.telerik.com/kendo-ui/aspnet-mvc/helpers/grid/excel-export#use-server-side-processing

We currently have this exact need, but I am unable to find any code giving an example of how to tie the grid data to the TDP library. The closest I can find relating to exporting with this library is http://docs.telerik.com/devtools/document-processing/libraries/radspreadstreamprocessing/export but the code samples are not closely related to my situation. Can you provide or point me to some code samples that show how to process a large data set from a Kendo grid?

 

Thank you.

9 Answers, 1 is accepted

Sort by
0
Alex Hajigeorgieva
Telerik team
answered on 29 Sep 2016, 05:50 AM
Hello,

I have already responded to the private support ticket, however, I will share my response here as well in case anyone else is looking for a sample implementation of a Kendo UI Grid with the RadSpreadProcessing library.

It is available at:

https://github.com/telerik/ui-for-aspnet-mvc-examples/tree/master/grid/grid-dpl-integration 

Regards,
Alex
Telerik by Progress
 
Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
0
praneeth
Top achievements
Rank 1
answered on 13 Jul 2018, 10:08 AM

Hi Alex Hajigeorgieva,

I am using kendo grid and I wanted to export that to excel. I have 80k records with 30 columns. So is it possible to export the data to excel. If yes could you share the demo piece of it. I am using visual studio 2015 with c# MVC platform. It is helpful if you share the demo on MVC.

0
Alex Hajigeorgieva
Telerik team
answered on 13 Jul 2018, 01:43 PM
Hello,

Since the data is already available to you on the server, perhaps you may have a look at the Server Export demo at:

https://demos.telerik.com/aspnet-mvc/grid/server-export

If you look at the .cshtml file, the button click sends only the columns configuration to the backend:

$(".download").click(function () {
    var grid = $("#Grid").data("kendoGrid");
 
    $("#export-model").val(encodeURIComponent(JSON.stringify(grid.columns)));
});

Then, change tab and you will see that the columns received from the client are used to build the spreadsheet on the server and are parsed to a list of the ExportColumnSettings class:



var columnsData = JsonConvert.DeserializeObject<IList<ExportColumnSettings>>(HttpUtility.UrlDecode(model));

This is almost identical to the demo I referenced in my previous response, where the model is mapped to a custom class:
https://github.com/telerik/ui-for-aspnet-mvc-examples/blob/master/grid/grid-dpl-integration/GridExcelSpreadProcessing/Controllers/StreamController.cs#L20

var modelObject = JsonConvert.DeserializeObject<IList<ColumnSettings>>(model);

Both of the projects are available to you and both are runnable so you may debug them and put breakpoints where desired - the one in the repository is open to the public and the one in our online demos is part of our distribution:

// Controller:
~telerik.ui.for.aspnetmvc.[VERSION].commercial\wrappers\aspnetmvc\Examples\VS2015\Kendo.Mvc.Examples\Controllers\Grid\Server_ExportController.cs
 
// View:
~telerik.ui.for.aspnetmvc.[VERSION].commercial\wrappers\aspnetmvc\Examples\VS2015\Kendo.Mvc.Examples\Views\gridserver_export.cshtml

https://www.telerik.com/account/product-download?product=KENDOUIMVC

Regards,
Alex Hajigeorgieva
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Angelo
Top achievements
Rank 1
answered on 28 Sep 2018, 04:19 AM

Hi Alex Hajigeorgieva,

Good Day, I hope you will consider my question in this thread. 

I'm having the same problem with downloading xlsx file from kendo ui grid. I am using Kendo UI for JQuery. Is there a way to export large dataset from kendo grid using this library instead of using Kendo UI for MVC? 

 

Current Code: 

//this kendo Grid will return 100k + rows

 $("#myTable").kendoGrid({
            toolbar: ["excel"],
            excel: {
                fileName: "Trade Reports.xlsx",
                filterable: true,
                allPages: true,
            },

Thank You,

 

0
Viktor Tachev
Telerik team
answered on 02 Oct 2018, 10:13 AM
Hi Angelo,

You can use the same approach like in the MVC example for submitting the relevant information to the server. There, the excel file can be generated and returned to the client. 

Also, you can specify a proxy in the excel export options. Specify the excel.proxyURL option to define the URL that will stream the file to the client-side. Then set the excel.forceProxy option to make sure that the proxy is always used.


Regards,
Viktor Tachev
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Angelo
Top achievements
Rank 1
answered on 04 Oct 2018, 06:20 AM

Hi Viktor,

Thank you for your suggestion. I only solved the problem by processing the creation of the Excel file after processing the data to be displayed in the Kendo Grid. I also created a separate function that will fetch that file from the server and download it client-side via FileResult View in MVC. I appreciated your answer.

 

Regards,

Angelo

0
Viktor Tachev
Telerik team
answered on 08 Oct 2018, 11:19 AM
Hi Angelo,

I am glad that you have the functionality up and running. Thank you for sharing your approach with the community.


Regards,
Viktor Tachev
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Pankaj
Top achievements
Rank 1
Veteran
answered on 24 Aug 2020, 07:35 PM
I did send filter to server side but i can convert to filter discritpor 
0
Viktor Tachev
Telerik team
answered on 27 Aug 2020, 02:38 PM

Hello Pankaj,

 

Would you share a sample project where the behavior you are seeing is replicated? This will enable us to examine the behavior and look for what is causing it.

 

Regards,
Viktor Tachev
Progress Telerik

Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive , special prizes and more, for FREE?! Register now for DevReach 2.0(20).

Tags
Grid
Asked by
PrimePay
Top achievements
Rank 1
Answers by
Alex Hajigeorgieva
Telerik team
praneeth
Top achievements
Rank 1
Angelo
Top achievements
Rank 1
Viktor Tachev
Telerik team
Pankaj
Top achievements
Rank 1
Veteran
Share this question
or