RadGrid 5 PDF Export

I was doing some little bit R&D on RAD Grid last night and would like to share a good feature and here is that… 

The biggest new features in RadGrid 5.0 is support for export to PDF. For quite some time, RadGrid has supported direct export to Microsoft Word and Excel formats, but the addition of PDF export elevates the Grid’s exporting capabilities to unprecedented levels. Using the new export feature couldn’t be easier. As with previous export formats, all that is required is a call to a single simple RadGrid method:

this.RadGrid1.MasterTableView.ExportToPdf();

When you call this method, all of the data in the Grid is exported to a new PDF that the users can then save to their local file system. The PDF is saved in a format that is compatible with Adobe Acrobat Reader 4.x and higher and by default uses the file name “RadGridExport.pdf”. If you do not like this name, you can change it in the new RadGrid ExportSettings section. This section gives you control over a number of PDF and general export parameters, such as:

  • FileName: change the file name of the exported file
  • ExportOnlyData: indicates if links and other basic HTML will be preserved on export (CSS styling will not be exported)
  • PDF Specific Settings:
    • Author: sets PDF metadata author value
    • Creator: sets PDF metadata creator value
    • PaperSize: sets PDF paper size
    • PageTitle: sets PDF page title (rendered on top of page)
    • Title: sets PDF metadata title value
    • Keywords: sets PDF metadata keyword value
    • AllowPrinting/Add/Copy/Modify: indicates if users have permission to print/add/copy/modify exported PDF

There are more settings available for controlling RadGrid exports, but the basic point is that you have a fair amount of control over your exported documents. You don’t have total control, though, so don’t expect RadGrid to provide the same level of formatting that you can find in Telerik Reporting. Exporting data to PDF from RadGrid will not preserve the Grid’s skin. Data will be rendered without any of the CSS styling you see in the browser and will use only the default font settings. You cannot control the PDF’s font size, color, face, or other formatting settings. You essentially get to set the page size, margins, and metadata and then let RadGrid do the rest. For more advanced exporting, you’ll need to check out Telerik Reporting.

Still, if you’ve been dying to offer PDF export to your users for RadGrid-based data, this is an amazing feature. It works without any trouble right out of the box and doesn’t require any special coding or web.config changes. This should be a great feature for anyone looking for a “poor man’s” reporting solution or the flexibility to export data in a universally readable format.

Advertisements

One thought on “RadGrid 5 PDF Export

  1. Pingback: RadGrid 5 PDF Export

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s