This is a migrated thread and some comments may be shown as answers.
Grid PDF Export shows filter row
1 Answer 21 Views
This is a migrated thread and some comments may be shown as answers.
cameron
Top achievements
Rank 1
Iron
cameron asked on 25 Mar 2020, 06:47 AM

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));
                })
            )


        )

 

1 Answer, 1 is accepted

Sort by
0
Petar
Telerik team
answered on 26 Mar 2020, 05:23 PM

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.
Tags
Grid
Asked by
cameron
Top achievements
Rank 1
Iron
Answers by
Petar
Telerik team
Share this question
or