Export to PDF - Page Template not Working Correctly

2 posts, 0 answers
  1. Randy
    Randy avatar
    75 posts
    Member since:
    Jul 2009

    Posted 05 Apr 2017 Link to this post

    I have the following code in an MVC page. When I export to PDF, the content in the "page-template" script tag prints at the bottom of the grid on each page instead of the top, as I thought it should because I've specified a class type of "header".


    <script type="x/kendo-template" id="page-template">
        <div class="page-template">
            <div class="header">
                <div style="float: right">Page #: pageNum # of #: totalPages #</div>
                Multi-page grid with automatic page breaking

    <div id="main-content" class="JeffreysContainer">
        <h3 class="text-center">Dealer Closeout History</h3>

                .Columns(columns =>
                    columns.Bound(p => p.CloseoutDate).Width(120).Format("{0:MM/dd/yyyy}");
                    columns.Bound(p => p.BeginDate).Width(120).Format("{0:MM/dd/yyyy}");
                    columns.Bound(p => p.EndDate).Width(120).Format("{0:MM/dd/yyyy}");
                    columns.Bound(p => p.BoothNumber).Title("Booth").Width(80);
                    columns.Bound(p => p.DealerName).Title("Dealer Name").Width(100);
                    columns.Bound(p => p.DealerId).Title("Dealer Id").Width(100);
                    columns.Bound(p => p.RetailSales).Width(125);
                    columns.Bound(p => p.WholesaleSales).Width(125);
                    columns.Bound(p => p.LayawayPayments).Title("Deposit Payments").Width(125);
                    columns.Bound(p => p.RentWithheld).Title("Rent").Width(125);
                    columns.Bound(p => p.CommissionWithheld).Title("Commissions").Width(125);
                    columns.Bound(p => p.ChargeCardFees).Title("Charge Fees").Width(125);
                    columns.Bound(p => p.AssessmentWithheld).Title("Asessment").Width(125);
                    columns.Bound(p => p.TotalPayout).Title("Total Payout").Width(125);
                    columns.Bound(p => p.CheckNumber).Title("Check Number").Width(125);
                .ToolBar(toolbar =>
                .Excel(excel => excel
                    .ProxyURL(Url.Action("ExcelExport", "Customer"))
                 .Pdf(pdf => pdf
                    .Margin("2cm", "1cm", "1cm", "1cm")
                    .Title("Closeout History")
                    .ProxyURL(Url.Action("PdfExport", "Dealer"))
                 .DataSource(dataSource => dataSource
                    .Batch(false)                                               // We want to perform batch operations
                    .PageSize(50)                                               // Set the page size
                    .Events(events => events.Error("gridErrorHandler"))         // Define a function that gets called on an error
                    .Read(read => read.Action("ReadCloseoutHistory", "Closeout"))  // The Read method in the controller

  2. Stefan
    Stefan avatar
    3008 posts

    Posted 07 Apr 2017 Link to this post

    Hello Randy,

    This is not a known issue and I was not able to reproduce it in my testing scenario.

    I used the same template and configuration options as in the provided code, and the application is working as expected:


    I can assume that the issue occurs due to a custom logic which we may be overlooking at this moment. Please provide a fully runnable example and I will gladly assist.

    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top