Grid PDF Export shows filter row

2 posts, 0 answers
  1. cameron
    cameron avatar
    1 posts
    Member since:
    Sep 2016

    Posted 25 Mar 2020 Link to this post

    have a simple grid that when I export to PDF the filter ros andboxes are on the PDF,    How do I exclude these from the PDF document.

    This is a MVC web app.

     

    Thanks in advance

     

    @(Html.Kendo().Grid< ShitTruckLibrary.Models.Contact>()
            .Name("WorkGrid")
              .ToolBar(tools => tools.Pdf())
            .Pdf(pdf => pdf
                .AllPages()
                .AvoidLinks()
                .PaperSize("A4")
                .Scale(0.8)
                .Margin("2cm", "1cm", "1cm", "1cm")
                .Landscape()
                .RepeatHeaders()
                .TemplateId("page-template")
                .FileName("Kendo UI Grid Export.pdf")
                .ProxyURL(Url.Action("Pdf_Export_Save", "Grid"))
                
            )
            .Columns(columns =>
            {
                columns.Bound(c => c.id).Hidden();
                columns.Bound(c => c.ForeName).Title("Forename").Filterable(ftb => ftb.Cell(cell => cell.ShowOperators(false)));
                columns.Bound(c => c.SurName).Title("Surname").Filterable(ftb => ftb.Cell(cell => cell.ShowOperators(false)));
                columns.Bound(c => c.CompanyName).Title("Customer").Filterable(ftb => ftb.Cell(cell => cell.ShowOperators(false)));
                columns.Bound(c => c.Address1).Title("Address 1").Filterable(ftb => ftb.Cell(cell => cell.ShowOperators(false)));
                columns.Bound(c => c.Address2).Title("Address 2").Filterable(ftb => ftb.Cell(cell => cell.ShowOperators(false)));
                columns.Bound(c => c.Phone1).Title("Phone 1");
                columns.Bound(c => c.Phone2).Title("Phone 2");
            })


            .HtmlAttributes(new { style = "height: 50vh;" })
            .Scrollable()
            .Filterable(ftb => ftb.Mode(GridFilterMode.Row))
            .Sortable()
            .Pageable(pageable => pageable
            .Refresh(true)
            .PageSizes(true)
            .ButtonCount(5))

            .DataSource(dataSource => dataSource
                    .Custom()

                    .PageSize(50)
                    .Transport(transport =>
                    {

                        transport.Read(read => read.Url("getwork").Data("getSearch").Type(HttpVerbs.Get));
                    })
                )


            )

     

  2. Petar
    Admin
    Petar avatar
    437 posts

    Posted 26 Mar 2020 Link to this post

    Hi Cameron,

    You can remove the filter rows from the exported PDF document by adding the following CSS:

          .k-pdf-export .k-filter-row{
            display:none;
          }

    You can check this Dojo example that demonstrates the usage of the above code. The result of the PDF export in the ASP.NET MVC context should be the same as in the linked Dojo.  

    Regards,
    Petar
    Progress Telerik

    Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
    Our thoughts here at Progress are with those affected by the outbreak.
Back to Top