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

Exporting all data in all pages

6 Answers 2463 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Reid
Top achievements
Rank 2
Reid asked on 22 Mar 2018, 08:02 PM

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

6 Answers, 1 is accepted

Sort by
1
Accepted
Alex Hajigeorgieva
Telerik team
answered on 23 Mar 2018, 11:30 AM
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.
0
Reid
Top achievements
Rank 2
answered on 26 Mar 2018, 01:48 PM

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

0
Accepted
Alex Hajigeorgieva
Telerik team
answered on 29 Mar 2018, 08:26 AM
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.
0
Reid
Top achievements
Rank 2
answered on 29 Mar 2018, 12:22 PM

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.

 

 

0
Accepted
Alex Hajigeorgieva
Telerik team
answered on 29 Mar 2018, 03:18 PM
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.
0
Jorge
Top achievements
Rank 1
answered on 14 May 2020, 01:25 AM
It worked!!! Thanks
Tags
Grid
Asked by
Reid
Top achievements
Rank 2
Answers by
Alex Hajigeorgieva
Telerik team
Reid
Top achievements
Rank 2
Jorge
Top achievements
Rank 1
Share this question
or