skip navigation
  • Product Bundles

    DevCraft

    All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:

    • AI Coding Assistants
    • Embedded Reporting
    • Document Processing Libraries
    • SSO Account Sign-in

    Web

    Kendo UI UI for Angular UI for Vue UI for jQuery KendoReact UI for Blazor UI for ASP.NET Core UI for ASP.NET MVC UI for ASP.NET AJAX

    Mobile

    UI for .NET MAUI

    Document Management

    Telerik Document Processing

    Desktop

    UI for .NET MAUI UI for WinUI UI for WinForms UI for WPF

    Reporting

    Telerik Reporting Telerik Report Server

    Testing & Mocking

    Test Studio Telerik JustMock

    CMS

    Sitefinity

    AI Productivity Tools

    AI Coding Assistants

    UI/UX Tools

    ThemeBuilder Design System Kit Templates and Building Blocks

    Debugging

    Fiddler Fiddler Everywhere Fiddler Classic Fiddler Everywhere Reporter FiddlerCore

    Free Tools

    KendoReact Free VB.NET to C# Converter Testing Framework
    View all products
  • Overview
  • Demos
    • What's New
    • Roadmap
    • Release History
  • Support and Learning

    • Support and Learning Hub
    • First Steps
    • Docs
    • Demos
    • Virtual Classroom
    • Forums
    • Videos
    • Blogs
    • Accessibility
    • Submit a Ticket

    Productivity and Design Tools

    • Visual Studio Extensions
    • Visual Studio Templates
    • Embedded Reporting
  • Pricing
  • Shopping cart
    • Account Overview
    • Your Licenses
    • Downloads
    • Support Center
    • Forum Profile
    • Payment Methods
    • Edit Profile
    • Log out
  • Login
  • Contact Us
  • Try now

Class GridViewPdfExport

GridViewPdfExport is an exporting API, allowing to export RadGridView to PDF format, utilizing the Document Processing Libraries.

Inheritance
System.Object
GridViewPdfExport
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Telerik.WinControls.Export
Assembly: Telerik.WinControls.GridView.dll

Syntax

public class GridViewPdfExport

Constructors

GridViewPdfExport(RadGridView)

Initializes a new instance of the GridViewPdfExport class.

Declaration
public GridViewPdfExport(RadGridView radGridView)
Parameters
RadGridView radGridView

The grid to export.

Fields

DateExportedString

Date when the exporting was started.

Declaration
public const string DateExportedString = "[Date Exported]"
Field Value
System.String

DatePrintedString

Obsolete. Use DateExportedString instead.

Declaration
[Obsolete("Obsolete. Use DateExportedString instead.")]
public const string DatePrintedString = "[Date Exported]"
Field Value
System.String

LogoString

Allows to add logo to the header or footer.

Declaration
public const string LogoString = "[Logo]"
Field Value
System.String

PageNumberString

Number of the current page

Declaration
public const string PageNumberString = "[Page #]"
Field Value
System.String

TimeExportedString

Time when the printing was started.

Declaration
public const string TimeExportedString = "[Time Exported]"
Field Value
System.String

TimePrintedString

Obsolete. Use DateExportedString instead.

Declaration
[Obsolete("Obsolete. Use TimeExportedString instead.")]
public const string TimePrintedString = "[Time Exported]"
Field Value
System.String

TotalPagesString

Total number of pages

Declaration
public const string TotalPagesString = "[Total Pages]"
Field Value
System.String

UserNameExportedString

Username associated with the current thread (the current Windows login))

Declaration
public const string UserNameExportedString = "[User Name]"
Field Value
System.String

UserNamePrintedString

Obsolete. Use UserNameExportedString instead.

Declaration
[Obsolete("Obsolete. Use UserNameExportedString instead.")]
public const string UserNamePrintedString = "[Time Exported]"
Field Value
System.String

Properties

ChildViewExportMode

Gets or sets the child view export mode.

Declaration
public ChildViewExportMode ChildViewExportMode { get; set; }
Property Value
ChildViewExportMode

The child view export mode.

ExportGroupedColumns

Gets or sets a value indicating whether grouped columns should be exported. Default value is true.

Declaration
public bool ExportGroupedColumns { get; set; }
Property Value
System.Boolean

ExportHeaderRowOnEachPage

Gets or sets a value indicating whether the header row should be exported on each page. Default value is true.

Declaration
public bool ExportHeaderRowOnEachPage { get; set; }
Property Value
System.Boolean

ExportHierarchy

Gets or sets if child rows should be exported.

Declaration
public bool ExportHierarchy { get; set; }
Property Value
System.Boolean

ExportSettings

Gets or sets export settings.

Declaration
public PdfExportSettings ExportSettings { get; set; }
Property Value
PdfExportSettings

ExportViewDefinition

Gets or sets a value indicating whether to export view definition.

Declaration
public bool ExportViewDefinition { get; set; }
Property Value
System.Boolean

ExportVisualSettings

Gets or sets a value indicating whether the visual settings should be exported.

Declaration
public bool ExportVisualSettings { get; set; }
Property Value
System.Boolean

true if visual settings are exported; otherwise, false.

FileExtension

Gets or sets the file extension of the exported file.

Declaration
public string FileExtension { get; set; }
Property Value
System.String

The file extension.

FitToPageWidth

Gets or sets a value indicating whether the content of page should fit into the page width. Default value is true.

Declaration
public bool FitToPageWidth { get; set; }
Property Value
System.Boolean

FooterFont

Gets or sets the font of the page footer.

Declaration
public Font FooterFont { get; set; }
Property Value
System.Drawing.Font

FooterHeight

Gets or sets the footer height.

Declaration
public double FooterHeight { get; set; }
Property Value
System.Double

HeaderFont

Gets or sets the font of the page header.

Declaration
public Font HeaderFont { get; set; }
Property Value
System.Drawing.Font

HeaderHeight

Gets or sets the header height.

Declaration
public double HeaderHeight { get; set; }
Property Value
System.Double

HiddenColumnOption

Gets or sets a value indicating how hidden columns are exported.

Declaration
public HiddenOption HiddenColumnOption { get; set; }
Property Value
HiddenOption

The hidden column option.

HiddenRowOption

Gets or sets a value indicating how hidden rows are exported.

Declaration
public HiddenOption HiddenRowOption { get; set; }
Property Value
HiddenOption

The hidden row option.

LeftFooter

Gets or sets the text that will be exported near the bottom left corner of the page.

Declaration
public string LeftFooter { get; set; }
Property Value
System.String

LeftHeader

Gets or sets the text that will be exported near the upper left corner of the page.

Declaration
public string LeftHeader { get; set; }
Property Value
System.String

Logo

Gets or sets the header/footer logo.

Declaration
public Image Logo { get; set; }
Property Value
System.Drawing.Image

LogoAlignment

Gets or sets the alignment of logo image in header/footer.

Declaration
public ContentAlignment LogoAlignment { get; set; }
Property Value
System.Drawing.ContentAlignment

LogoLayout

Gets or sets the way the logo is drawn.

Declaration
public LogoLayout LogoLayout { get; set; }
Property Value
LogoLayout

MiddleFooter

Gets or sets the text that will be exported at the bottom center of the page.

Declaration
public string MiddleFooter { get; set; }
Property Value
System.String

MiddleHeader

Gets or sets the text that will be exported at the top center of the page.

Declaration
public string MiddleHeader { get; set; }
Property Value
System.String

PageMargins

Gets or Sets the margins of pages that will be exported in millimeters.

Declaration
public Padding PageMargins { get; set; }
Property Value
System.Windows.Forms.Padding

PageSize

Gets or sets the page size in millimeters for the exported file. Default size is 210x297mm(A4 portrait).

Declaration
public SizeF PageSize { get; set; }
Property Value
System.Drawing.SizeF

PagingExportOption

Gets or sets a value indicating how the export behaves when paging is enabled.

Declaration
public PagingExportOption PagingExportOption { get; set; }
Property Value
PagingExportOption

The paging export option.

RadGridViewToExport

Gets or sets the RadGridView to export.

Declaration
public RadGridView RadGridViewToExport { get; set; }
Property Value
RadGridView

The RadGridView to export.

ReverseFooterOnEvenPages

[true] if the LeftFooter and RightFooter should be reversed on even pages, [false] otherwise.

Declaration
public bool ReverseFooterOnEvenPages { get; set; }
Property Value
System.Boolean

ReverseHeaderOnEvenPages

[true] if the LeftHeader and RightHeader should be reversed on even pages, [false] otherwise.

Declaration
public bool ReverseHeaderOnEvenPages { get; set; }
Property Value
System.Boolean

RightFooter

Gets or sets the text that will be exported near the bottom right corner of the page.

Declaration
public string RightFooter { get; set; }
Property Value
System.String

RightHeader

Gets or sets the text that will be exported near the upper right corner of the page.

Declaration
public string RightHeader { get; set; }
Property Value
System.String

RowIndent

Gets or sets the indent of group and hierarchy rows.

Declaration
public double RowIndent { get; set; }
Property Value
System.Double

Scale

Gets or sets the document scaling. Default value is 1. For example, scale of 1.2f means 20% size increase.

Declaration
public double Scale { get; set; }
Property Value
System.Double

ShowHeaderAndFooter

Gets or sets a value indicating whether header and footer should be exported.

Declaration
public bool ShowHeaderAndFooter { get; set; }
Property Value
System.Boolean

SummariesExportOption

Gets or sets a value indicating how summary rows are exported.

Declaration
public SummariesOption SummariesExportOption { get; set; }
Property Value
SummariesOption

The summaries export option.

Methods

CancelExport()

Cancels current export operation.

Declaration
public void CancelExport()

CancelExportAsync()

Cancels an asynchronous export operation.

Declaration
public void CancelExportAsync()

DetachSparkElemnt()

Declaration
protected virtual void DetachSparkElemnt()

DrawFooter()

Exports the footer part of the page.

Declaration
protected virtual void DrawFooter()

DrawHeader()

Exports the header part of the page.

Declaration
protected virtual void DrawHeader()

GetNumberOfPages(ExportGridTraverser)

Declaration
public int GetNumberOfPages(ExportGridTraverser traverser)
Parameters
ExportGridTraverser traverser

Returns
System.Int32

GetRowSize(GridViewRowInfo, TableViewRowLayoutBase)

Gets the row size using the provided row layout.

Declaration
protected virtual Size GetRowSize(GridViewRowInfo row, TableViewRowLayoutBase rowLayout)
Parameters
GridViewRowInfo row

The row to measure.

TableViewRowLayoutBase rowLayout

The row layout to be used for the measure.

Returns
System.Drawing.Size

The size of the row.

OnAsyncExportCompleted(AsyncCompletedEventArgs)

Raises the AsyncExportCompleted event.

Declaration
protected virtual void OnAsyncExportCompleted(AsyncCompletedEventArgs e)
Parameters
System.ComponentModel.AsyncCompletedEventArgs e

The System.ComponentModel.AsyncCompletedEventArgs instance containing the event data.

OnAsyncExportProgressChanged(ProgressChangedEventArgs)

Raises the AsyncExportProgressChanged event.

Declaration
protected virtual void OnAsyncExportProgressChanged(ProgressChangedEventArgs e)
Parameters
System.ComponentModel.ProgressChangedEventArgs e

The System.ComponentModel.ProgressChangedEventArgs instance containing the event data.

OnCellFormatting(PdfExportCellFormattingEventArgs)

Raises the CellFormatting event.

Declaration
protected virtual void OnCellFormatting(PdfExportCellFormattingEventArgs e)
Parameters
PdfExportCellFormattingEventArgs e

The PdfExportCellFormattingEventArgs instance containing the event data.

OnCellPaint(ExportCellPaintEventArgs)

Raises the CellPaint event.

Declaration
protected virtual void OnCellPaint(ExportCellPaintEventArgs e)
Parameters
ExportCellPaintEventArgs e

The ExportCellPaintEventArgs instance containing the event data.

OnChildViewExporting(ChildViewExportingEventArgs)

Raises the ChildViewExporting event.

Declaration
protected virtual void OnChildViewExporting(ChildViewExportingEventArgs e)
Parameters
ChildViewExportingEventArgs e

The ChildViewExportingEventArgs instance containing the event data.

OnFooterExported(ExportEventArgs)

Raises the FooterExported event.

Declaration
protected virtual void OnFooterExported(ExportEventArgs e)
Parameters
ExportEventArgs e

The ExportEventArgs instance containing the event data.

OnHeaderExported(ExportEventArgs)

Raises the HeaderExported event.

Declaration
protected virtual void OnHeaderExported(ExportEventArgs e)
Parameters
ExportEventArgs e

The ExportEventArgs instance containing the event data.

OnPdfExported(EventArgs)

Raises the PDFExported event.

Declaration
protected virtual void OnPdfExported(EventArgs e)
Parameters
System.EventArgs e

The System.EventArgs instance containing the event data.

ParseHeaderFooterString(String)

Parses a given string for special words.

Declaration
protected string ParseHeaderFooterString(string s)
Parameters
System.String s

The string.

Returns
System.String

The parsed string.

RunExport(Stream, IPdfExportRenderer)

Starts an export operation.

Declaration
public void RunExport(Stream exportStream, IPdfExportRenderer exportRenderer)
Parameters
System.IO.Stream exportStream

The Stream where the RadGridView will be exported.

IPdfExportRenderer exportRenderer

Instance of IPdfExportRenderer class.

RunExport(String, IPdfExportRenderer)

Starts an export operation.

Declaration
public void RunExport(string fileName, IPdfExportRenderer pdfExportRenderer)
Parameters
System.String fileName

The file name where data will be exported.

IPdfExportRenderer pdfExportRenderer

.

RunExportAsync(Stream, IPdfExportRenderer)

Starts an export operation that runs in a background thread.

Declaration
public void RunExportAsync(Stream exportStream, IPdfExportRenderer exportRenderer)
Parameters
System.IO.Stream exportStream

The stream where data will be exported.

IPdfExportRenderer exportRenderer

Instance of IPdfExportRenderer class.

RunExportAsync(String, IPdfExportRenderer)

Starts an export operation that runs in a background thread.

Declaration
public void RunExportAsync(string fileName, IPdfExportRenderer exportRenderer)
Parameters
System.String fileName

The file name where data will be exported.

IPdfExportRenderer exportRenderer

Instance of IPdfExportRenderer class.

Events

AsyncExportCompleted

Occurs when an async export operation is completed.

Declaration
public event AsyncCompletedEventHandler AsyncExportCompleted
Event Type
System.ComponentModel.AsyncCompletedEventHandler

AsyncExportProgressChanged

Occurs when the progress of an async export operation changes.

Declaration
public event ProgressChangedEventHandler AsyncExportProgressChanged
Event Type
System.ComponentModel.ProgressChangedEventHandler

CellFormatting

Occurs for every cell that is being exported.

Declaration
public event PdfExportCellFormattingEventHandler CellFormatting
Event Type
PdfExportCellFormattingEventHandler

CellPaint

Occurs when a cell is drawn.

Declaration
public event ExportCellPaintEventHandler CellPaint
Event Type
ExportCellPaintEventHandler

ChildViewExporting

Occurs when a child view will be exported.

Declaration
public event ChildViewExportingEventHandler ChildViewExporting
Event Type
ChildViewExportingEventHandler

FooterExported

Occurs when the footer is exported.

Declaration
public event ExportEventHandler FooterExported
Event Type
ExportEventHandler

HeaderExported

Occurs when the header is exported.

Declaration
public event ExportEventHandler HeaderExported
Event Type
ExportEventHandler

PdfExported

Occurs when the export process completes.

Declaration
public event EventHandler PdfExported
Event Type
System.EventHandler

Extension Methods

SvgExtentions.Traverse<T>(T, Func<T, IEnumerable<T>>)
SvgExtentions.TraverseDepthFirst<T>(T, Func<T, IEnumerable<T>>)
Getting Started
  • Install Now
  • Demos
  • Step-by-Step Tutorial
  • Sample Applications
  • SDK Samples
  • Visual Studio Extensions
Support Resources
  • Code Library
  • Knowledge Base
  • Videos
Community
  • Forums
  • Blogs
  • Feedback Portal
  • Document Processing Feedback Portal

Copyright © 2018 Progress Software Corporation and/or its subsidiaries or affiliates.
All Rights Reserved.

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.