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

Excel Export With Ajax Paging

5 Answers 323 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Umut
Top achievements
Rank 1
Umut asked on 25 Mar 2015, 04:13 PM
I did the same as tutorial http://demos.telerik.com/aspnet-mvc/grid/excel-export . But as you can see in the tutorial, when you export the excel, it contains only page 1. 
I want to export all the the pages. How should i do ? 

Regards.

5 Answers, 1 is accepted

Sort by
0
Dimiter Madjarov
Telerik team
answered on 27 Mar 2015, 07:47 AM

Hello Umut,

In order to achieve this you should enable the allPages options of the Excel export.
E.g.

.Excel(excel => excel
    .FileName("Kendo UI Grid Export.xlsx")
    .AllPages(true)
    ...
)

 

Regards,
Dimiter Madjarov
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
0
David
Top achievements
Rank 1
answered on 09 Jun 2015, 01:37 PM

I followed the example EXACTLY, and added the lines you indicated above...it still only prints the current page.

 (I got rid of the groupings, totals, and changed the model to match my model...but everything else is the same)

Thoughts?

 

Grid Code Below:

 

@(Html.Kendo().Grid<DairyDashboard.MVC.ViewModels.Home.MyHerdViewModel>()
    .Name("grid")
    .HtmlAttributes(new { style = "width: 900px" })
    .Columns(columns =>
    {
        columns.Bound(p => p.AnimalId).Width(300);
    })
    .ToolBar(tools => tools.Excel())
    .Pageable()
    .Sortable()
    .Scrollable()
    .Groupable()
    .Excel(excel => excel
        .FileName("Kendo UI Grid Export.xlsx")
        .AllPages(true)
        .Filterable(true)
        .ProxyURL(Url.Action("Excel_Export_Save", "Home"))
    )
    .Reorderable(r => r.Columns(true))
    .Resizable(r => r.Columns(true))
    .ColumnMenu()
    .DataSource(dataSource => dataSource
        .Ajax()
        .PageSize(30)
            .Read(read => read.Action("Excel_Export_Read", "Home"))
    )
)

 

 

 

0
Dimiter Madjarov
Telerik team
answered on 09 Jun 2015, 03:01 PM

Hello David,

The provided sample code seems correct, so I cannot state for sure why only the current page is exported. Please provide small isolated runnable example that I could inspect locally and assist further.

I am looking forward to hearing from you.

Regards,
Dimiter Madjarov
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
David
Top achievements
Rank 1
answered on 09 Jun 2015, 03:31 PM

I was incorrectly setting a page size in my controller action...this was preventing the return of all data.

 

Issue resolved.

0
Dimiter Madjarov
Telerik team
answered on 10 Jun 2015, 08:53 AM

Hello David,

Thanks for the update. I am glad the issue is resolved.

Regards,
Dimiter Madjarov
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Grid
Asked by
Umut
Top achievements
Rank 1
Answers by
Dimiter Madjarov
Telerik team
David
Top achievements
Rank 1
Share this question
or