Concerning the Question #1,
I have 3 buttons:
- "Print this page" (exports just the page they are on to PDF)
- "Export all records to PDF" (exports all the grid data to PDF)
- "Export all records to Excel" (exports all the grid data to an Excel File)
@(Html.Kendo().Grid<
ProviderResults
>()
.Name("grdProviderSearchReport")
.Columns(c =>
{
//(column info removed)
})
.Groupable()
.Reorderable(reorder => reorder.Columns(true))
.Filterable()
.ToolBar(tools =>
{
tools.Pdf().Text("Print this page");
tools.Pdf().Text("Export all records to PDF");
tools.Excel().Text("Export all records to Excel");
}
)
.Pdf(pdf => pdf
.AllPages()
.AvoidLinks()
.PaperSize("A4")
.Scale(0.8)
.Margin("2cm", "1cm", "1cm", "1cm")
.Landscape()
.RepeatHeaders()
.TemplateId("page-template")
.FileName("ProviderSearch_PageLevel.pdf")
.ProxyURL(Url.Action("Pdf_Export_Save", "Grid"))
)
.Pdf(pdf => pdf
.AllPages()
.AvoidLinks()
.PaperSize("A4")
.Scale(0.8)
.Margin("2cm", "1cm", "1cm", "1cm")
.Landscape()
.RepeatHeaders()
.TemplateId("page-template")
.FileName("ProviderSearch_AllRecords.pdf")
.ProxyURL(Url.Action("Pdf_Export_Save", "Grid"))
)
.Excel(excel => excel
.FileName("All_Provider_Search_Report.xlsx")
.Filterable(true)
.ProxyURL(Url.Action("Excel_Export_Save", "Grid"))
.AllPages(true)
)
.Pageable()
.Sortable()
.Groupable()
.Pageable(pageable => pageable
.Refresh(true)
.ButtonCount(3))
.Events(events => events
.DataBound("onGridDataBound")
)
.DataSource(d => d.Ajax()
.PageSize(12)
.Model(m => m.Id(r => r.ProviderId))
.Read(read => read.Action("ProviderSearchReportGridData", "ProviderReports").Data("ProviderSearchViewModelData"))
.Sort(sort => sort.Add("ProviderId").Ascending())
)
//.HtmlAttributes(new { style = "height:500px;" })
)
The "Export all records to PDF" doesn't get all the data surly because the "All Pages" is false, but it can't be set to true.
Any suggestions?
Thanks