Server Side Pagination Excel Export

1 Answer 27 Views
Grid Pager
Joey
Top achievements
Rank 1
Joey asked on 21 Feb 2024, 03:12 PM

Hi,

I'm looking to do the Excel Export with server side paging. Since we are server side paging, we are only exporting what is displayed on the screen at the time. I scoured the docs and knowledge base, but couldn't find any documentation or discussions pertaining to this. 

 

Thanks for the help!

Joey

1 Answer, 1 is accepted

Sort by
0
Mihaela
Telerik team
answered on 26 Feb 2024, 10:01 AM

Hello Joey,

You can export all records to Excel by enabling the AllPages() option, which is disabled by default:

@(Html.Kendo().Grid<Kendo.Mvc.Examples.Models.ProductViewModel>()
	.Name("grid")
	.Excel(excel => excel.AllPages(true))
        .ToolBar(tools => tools.Excel())
        ...
)

Here is a REPL sample for your reference:

https://netcorerepl.telerik.com/wouGGAlk00SNWwyH48

 

Regards,
Mihaela
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages. If you're new to the Telerik family, be sure to check out our getting started resources, as well as the only REPL playground for creating, saving, running, and sharing server-side code.
Joey
Top achievements
Rank 1
commented on 26 Feb 2024, 01:57 PM

Hey!

We have all pages set to true, and that works for grids that are client side paged, but not server side. We are doing our server side paging by sending skips and takes to a custom stored procedure that we wrote. If there isn't a great way to handle this via Telerik API, then I'm sure we can just write something to create our own excel files to download.
Mihaela
Telerik team
commented on 27 Feb 2024, 02:06 PM

Hey Joey,

Generally, the server operations are performed server-side (the ServerOperation() option is enabled by default), so the Grid in the REPL sample uses server-side paging.

Would you please share the Grid configuration at your end, so I can review it?

Also, as an alternative solution, I would suggest exporting the Excel file server-side, as demonstrated in the online demo:

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

(Check out the View Source section to examine the source code)

Best,

Mihaela

Tags
Grid Pager
Asked by
Joey
Top achievements
Rank 1
Answers by
Mihaela
Telerik team
Share this question
or