New to Telerik UI for ASP.NET MVC? Download free 30-day trial

ASP.NET MVC Grid PDF Export

Loading Demo...
  • EXAMPLE
  • VIEW SOURCE
pdf_export.cshtml
Pdf_ExportController.cs

Also available for:

CLIENT-SIDE API SERVER-SIDE API

Description

The Telerik UI for ASP.NET MVC Grid provides a built-in PDF export functionality. The PDF format is very popular and widely used to present documents independently from the application software, hardware, and operating systems.

This demo shows how to export the content of the ASP.NET MVC Data Grid to PDF by using a straightforward approach—to export the content of the component to PDF, include the corresponding command to its toolbar by setting .ToolBar(tools => tools.Pdf()). For greater control over the output, configure the PDF export setting. For instance, you can specify the file name and whether to export all pages, margins, paper size, font, and so on. To initiate the PDF export programmatically, call the saveAsPdf() method from the client-side API.

Additionally, you can customize the appearance of the exported Data Grid table by providing a template through the .Pdf(pdf => pdf.TemplateId("page-template")) method.

This demo also demonstrates how to exclude a Grid column from export by configuring the Exportable setting.

For more information about the PDF export capabilities, refer to the official Telerik UI for ASP.NET MVC Data Grid product documentation on the available PDF export approaches.

Additional Apps

This Grid example is part of a unique collection of hundreds of ASP.NET MVC demos, with which you can see all Telerik ASP.NET MVC components and their features in action. View the source code of the demos from the library or directly adapt, and edit them and their theme appearance in the ThemeBuilder.

Support & Learning Resources

Additional Resources