Exporting large Kendo grid dataset

10 posts, 0 answers
  1. PrimePay
    PrimePay avatar
    25 posts
    Member since:
    Feb 2015

    Posted 23 Sep 2016 Link to this post

    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.

  2. Alex Hajigeorgieva
    Admin
    Alex Hajigeorgieva avatar
    1082 posts

    Posted 29 Sep 2016 Link to this post

    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.
  3. praneeth
    praneeth avatar
    1 posts
    Member since:
    Feb 2018

    Posted 13 Jul 2018 Link to this post

    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.

  4. Alex Hajigeorgieva
    Admin
    Alex Hajigeorgieva avatar
    1082 posts

    Posted 13 Jul 2018 Link to this post

    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.
  5. Angelo
    Angelo avatar
    2 posts
    Member since:
    Sep 2018

    Posted 27 Sep 2018 in reply to Alex Hajigeorgieva Link to this post

    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,

     

  6. Viktor Tachev
    Admin
    Viktor Tachev avatar
    2501 posts

    Posted 02 Oct 2018 Link to this post

    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.
  7. Angelo
    Angelo avatar
    2 posts
    Member since:
    Sep 2018

    Posted 04 Oct 2018 in reply to Viktor Tachev Link to this post

    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

  8. Viktor Tachev
    Admin
    Viktor Tachev avatar
    2501 posts

    Posted 08 Oct 2018 Link to this post

    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.
  9. Pankaj
    Pankaj avatar
    20 posts
    Member since:
    Mar 2015

    Posted 24 Aug 2020 in reply to Viktor Tachev Link to this post

    I did send filter to server side but i can convert to filter discritpor 
  10. Viktor Tachev
    Admin
    Viktor Tachev avatar
    2501 posts

    Posted 27 Aug 2020 Link to this post

    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).

Back to Top