Exporting all data in all pages

7 posts, 3 answers
  1. Reid
    Reid avatar
    448 posts
    Member since:
    Oct 2008

    Posted 22 Mar 2018 Link to this post

    When I choose the export button enabled in options only the first page exports.  I am using scrollable() in the configuration.

    Is there a way to export it natively to export all rows?

    Thanks

  2. Answer
    Alex Hajigeorgieva
    Admin
    Alex Hajigeorgieva avatar
    1082 posts

    Posted 23 Mar 2018 Link to this post

    Hello, Reid,

    To enable the export of all the pages of the Kendo UI Grid, you should just add AllPages(true) to the ExcelExport() configuration:

    @(Html.Kendo().Grid<OrderViewModel>()
     .Name("grid")
     .Excel(e=>e.AllPages(true))

    https://docs.telerik.com/kendo-ui/api/javascript/ui/grid/configuration/excel.allpages

    Let me know should you need further information.

    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.
  3. Reid
    Reid avatar
    448 posts
    Member since:
    Oct 2008

    Posted 26 Mar 2018 in reply to Alex Hajigeorgieva Link to this post

    That worked somewhat.  If the grid is buffering a few thousand records it limits I think to what?  The page size?  Because the dataset is still limited.  I could of course use alternate tools like Apose to export the dataset nicely but I am new to using this feature and wanted to investigate the way it was built.  Like again 1) getting to all the records in all pages 2) Turning off the headers or reformatting them to not show the column filtering icons and the paging icons in the footer.  More sort of just column names and data output.

    Can you suggest an approach with the Core UI MVC Grid class with respect to exporting using any API?

     

    Thanks

  4. Answer
    Alex Hajigeorgieva
    Admin
    Alex Hajigeorgieva avatar
    1082 posts

    Posted 29 Mar 2018 Link to this post

    Hello, Reid,

    The comments about the filtering icons and the pager lead me to believe that you were inquiring about the Kendo UI Grid for ASP.NET Core PDF Export as opposed to the Excel export.

    If using the PDF export, the property is the same - AllPages(). When the AllPages() configuration is set, internally we check the dataSource.totalPages() and start creating the document which will be exported offscreen. Then we unbind the data source change event and start paging till the last page is reached. At this point, we page to page 1 and the multipage document gets exported, the change of the data source bound back again. 

    For best performance of our client-side PDF export, we recommend using the Pako Deflate library. 

    To hide certain elements from the PDF Export, you can place a CSS rule which will be used during the PDF Export by targetting the desired elements like this:



    .k-pdf-export .k-grid-toolbar, /* hides toolbar */
    .k-pdf-export .k-pager-wrap  /* hides pager*/
    .k-pdf-export .k-grid-filter /* hides filter icon */
    {
      display: none;
    }

    You may also provide a custom page template: https://docs.telerik.com/kendo-ui/controls/data-management/grid/pdf-export#page-template

    Let me know if you need further information. 

    Kind 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. Reid
    Reid avatar
    448 posts
    Member since:
    Oct 2008

    Posted 29 Mar 2018 in reply to Alex Hajigeorgieva Link to this post

    Hello Alex,

    I am using Telerik Kendo UI with.NET Core as the solution structure.  The latest version.  The grid is not declared in client side JS but rather using the @(Html.Kendo().Grid<MyModelClass>() type declaration.  I cannot see how to implement this property in that construct.  This export happening now is the internal Toolbar options parameter (toolbar => toolbar.Pdf());

    I will take a look at the link you provide at the bottom of your response.  Ultimately that Is what is needed.  I could as well use a standard JS click event and route to an export controller action and build the .pdf in a custom way and just push it to the response.

     

     

  6. Answer
    Alex Hajigeorgieva
    Admin
    Alex Hajigeorgieva avatar
    1082 posts

    Posted 29 Mar 2018 Link to this post

    Hello, Reid,

    To implement all pages for the Kendo UI Grid for ASP.NET Core, you need to add the Pdf() configuration settings:

    .ToolBar(tools => tools.Pdf())
    .Pdf(pdf => pdf
       .AllPages()
       .TemplateId("page-template")
    )

    This is the use case which is shown in our official PDF Export demo:

    https://demos.telerik.com/aspnet-core/grid/pdf-export

    If you wish to create a PDF document server-side with some third-party library, then you can use the example that we have at:

    https://github.com/telerik/ui-for-aspnet-mvc-examples/tree/master/grid/pdf-export-server-side
    *file export logic here 

    If you wish to use a proxy, you can check out some sample implementations that we have, and also define it as a setting in the Pdf Options:

    .Pdf(pdf => pdf
    .ProxyURL(Url.Action("Pdf_Export_Save", "Grid"))
    )

    Let me know what is on your mind and I would be glad to provide further information.

    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.
  7. Jorge
    Jorge avatar
    4 posts
    Member since:
    Jun 2018

    Posted 13 May 2020 in reply to Alex Hajigeorgieva Link to this post

    It worked!!! Thanks
Back to Top