I am trying to get the export PDF of my grids to have the heads repeated on each page. Following the awful documentation I have been unable to get it to work. Some of the other functions work and others are ignored, however I'm only concerned about the headers.
Here is my grid code:
@(Html.Kendo().Grid<TheGridName>()
.Name("mainGrid")
.HtmlAttributes(new { @class = "gridHeight"})
.Columns(col =>
{
col.Bound(c => c.col1).Title("Test 1");
col.Bound(c => c.col2).Title("Test 2");
col.Bound(c => c.col3).Title("Test 3");
col.Bound(c => c.col4).Title("Test 4");
col.Bound(c => c.col5).Title("Test 5");
col.Bound(c => c.col6).Title("Test 6").;
})
.ToolBar(toolbar =>
{
toolbar.Excel();
toolbar.Pdf();
})
.Pdf(pdf => pdf
.AllPages(true)
.AvoidLinks(false)
.PaperSize("8in" , "11.5in")
.Margin("2cm", "1cm", "1cm", "1cm")
.Landscape(true)
.Scale(0.8)
.RepeatHeaders(true)
.FileName("Kendo UI Grid Export.pdf")
.ProxyURL(Url.Action("Pdf_Export_Save", "Grid"))
)
.Sortable()
.Scrollable()
.Filterable()
.Resizable(r => r.Columns(true))
.Reorderable(r => r.Columns(true))
.Excel(excel => excel
.FileName("test.xlsx"))
.Events(x =>
{
x.ExcelExport("excelExport");
})
.ColumnMenu()
.DataSource(ds => ds.Ajax()
.Read(r => r.Url($"?handler=Read").Data("dataFunction"))
.ServerOperation(false)
))
My Kendo and other important includes:
<script src="https://kendo.cdn.telerik.com/2023.1.314/js/kendo.all.min.js"></script>
<script src="https://kendo.cdn.telerik.com/2023.1.314/js/kendo.aspnetmvc.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pako/2.1.0/pako.min.js"></script>
I'm guessing, like a lot of other features, this doesn't work in ASP.NET Core and this is some kind of copy paste error on Telerik's part and this only works in the jQuery version or something.
Just so you know I've tried all kinds of different permutations of Repeat Headers:
repeatHeaders
repeatheaders
RepeatHeaders
repeat-headers
and so on as I have seen it done in many many different ways across different documentation and posts.