Telerik MVC grid PDF Export not working

3 posts, 0 answers
  1. Federico
    Federico avatar
    5 posts
    Member since:
    Feb 2016

    Posted 22 Feb Link to this post

    I'm testing the grid for an almost certain purchase, and I've tried to export it to both PDF and XLS. With Excel it was almost straight forward, but when I try to follow the steps presented on the demo ( it does not work. When I click on the export button, the progress bar loads and when it finishes nothing happens, the action never gets to be executed.

    This is my view:

    @model IEnumerable<ViewModels.TestViewModel>

        ViewBag.Title = "Tests KendoUI";

    <script src="~/Scripts/lib/jszip.min.js" type="text/javascript"></script>
    <script src="~/Scripts/lib/pako.min.js" type="text/javascript"></script>

                    Use the DejaVu Sans font for display and embedding in the PDF file.
                    The standard PDF fonts have no support for Unicode characters.
        .k-grid {
            font-family: "DejaVu Sans", "Arial", sans-serif;

        /* Hide the Grid header and pager during export */
        .k-pdf-export .k-grid-toolbar,
        .k-pdf-export .k-pager-wrap,
        .k-pdf-export a.k-button.k-button-icontext,
        .k-pdf-export .k-filter-row,
        .k-pdf-export .k-grouping-header,
        .k-pdf-export .k-grid tr td:last-child {
            display: none !important;

          .DataSource(dataSource => dataSource
              .Read(read => read.Action("Products_Read", "Home"))
              .Aggregates(aggregates => aggregates.Add(p => p.oper_monto).Sum())
          .Columns(columns =>
            columns.Bound(p => p.oper_numero).Hidden(true);
            columns.Bound(p => p.oper_monto).ClientFooterTemplate("Total: #=sum#");
            columns.Bound(p => p.cpto_codigo);
          .Excel(excel => excel
            .ProxyURL(Url.Action("Excel_Export_Save", "Home"))
          .Pdf(pdf => pdf
                .ProxyURL(Url.Action("Pdf_Export_Save", "Home"))
          .ToolBar(t => t.Excel().Text("Exportar a Excel"))
          .ToolBar(t => t.Pdf().Text("Exportar a PDF"))
          .ToolBar(toolBar => 
                            .Text("Guardar Preferencias")
                            .HtmlAttributes(new { id = "save" })
          .ToolBar(toolBar =>
                            .Text("Cargar Preferencias")
                            .HtmlAttributes(new { id = "load" })
          .Filterable(ftb => ftb.Mode(GridFilterMode.Menu))


        $(function () {
            var grid = $("#grid").data("kendoGrid");

            $("#save").click(function (e) {
                localStorage["kendo-grid-options"] = kendo.stringify(grid.getOptions());

            $("#load").click(function (e) {
                var options = localStorage["kendo-grid-options"];
                if (options) {

    And this is my controller action:

            public ActionResult Pdf_Export_Save(string contentType, string base64, string fileName)
                var fileContents = Convert.FromBase64String(base64);

                return File(fileContents, contentType, fileName);


    Thanks in advance.

  2. Federico
    Federico avatar
    5 posts
    Member since:
    Feb 2016

    Posted 22 Feb in reply to Federico Link to this post

    Well, the export function uses a js named pako that you can find here:, but if you right click and download the file, it will fail and download it anyways, but the code inside it won't be the necessary javascript. So, I had to enter the file, copy all the text and paste it in my local file. It works like a charm.
  3. UI for ASP.NET AJAX banner
  4. Dimiter Madjarov
    Dimiter Madjarov avatar
    2123 posts

    Posted 24 Feb Link to this post

    Hello Federico,

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

    Dimiter Madjarov
    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
Back to Top