New to Telerik UI for WinForms? Start a free 30-day trial

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

Definition

Namespace:Telerik.WinControls.Export

Assembly:Telerik.WinControls.GridView.dll

Syntax:

C#
public class GridViewPdfExport

Inheritance: objectGridViewPdfExport

Constructors

Initializes a new instance of the GridViewPdfExport class.

C#
public GridViewPdfExport(RadGridView radGridView)
Parameters:radGridViewRadGridView

The grid to export.

Fields

Date when the exporting was started.

C#
public const string DateExportedString = "[Date Exported]"

Allows to add logo to the header or footer.

C#
public const string LogoString = "[Logo]"

Number of the current page

C#
public const string PageNumberString = "[Page #]"

Time when the printing was started.

C#
public const string TimeExportedString = "[Time Exported]"

Total number of pages

C#
public const string TotalPagesString = "[Total Pages]"

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

C#
public const string UserNameExportedString = "[User Name]"

Properties

Gets or sets the child view export mode.

C#
public ChildViewExportMode ChildViewExportMode { get; set; }
Property Value:

The child view export mode.

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

C#
public bool ExportGroupedColumns { get; set; }

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

C#
public bool ExportHeaderRowOnEachPage { get; set; }

Gets or sets if child rows should be exported.

C#
public bool ExportHierarchy { get; set; }

Gets or sets export settings.

C#
public PdfExportSettings ExportSettings { get; set; }

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

C#
public bool ExportViewDefinition { get; set; }

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

C#
public bool ExportVisualSettings { get; set; }
Property Value:

true if visual settings are exported; otherwise, false.

Gets or sets the file extension of the exported file.

C#
public string FileExtension { get; set; }
Property Value:

The file extension.

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

C#
public bool FitToPageWidth { get; set; }

Gets or sets the font of the page footer.

C#
public Font FooterFont { get; set; }

Gets or sets the footer height.

C#
public double FooterHeight { get; set; }

Gets or sets the font of the page header.

C#
public Font HeaderFont { get; set; }

Gets or sets the header height.

C#
public double HeaderHeight { get; set; }

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

C#
public HiddenOption HiddenColumnOption { get; set; }
Property Value:

The hidden column option.

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

C#
public HiddenOption HiddenRowOption { get; set; }
Property Value:

The hidden row option.

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

C#
public string LeftFooter { get; set; }

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

C#
public string LeftHeader { get; set; }

Gets or sets the header/footer logo.

C#
public Image Logo { get; set; }

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

C#
public ContentAlignment LogoAlignment { get; set; }

Gets or sets the way the logo is drawn.

C#
public LogoLayout LogoLayout { get; set; }

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

C#
public string MiddleFooter { get; set; }

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

C#
public string MiddleHeader { get; set; }

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

C#
public Padding PageMargins { get; set; }

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

C#
public SizeF PageSize { get; set; }

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

C#
public PagingExportOption PagingExportOption { get; set; }
Property Value:

The paging export option.

Gets or sets the RadGridView to export.

C#
public RadGridView RadGridViewToExport { get; set; }
Property Value:

The RadGridView to export.

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

C#
public bool ReverseFooterOnEvenPages { get; set; }

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

C#
public bool ReverseHeaderOnEvenPages { get; set; }

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

C#
public string RightFooter { get; set; }

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

C#
public string RightHeader { get; set; }

Gets or sets the indent of group and hierarchy rows.

C#
public double RowIndent { get; set; }

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

C#
public double Scale { get; set; }

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

C#
public bool ShowHeaderAndFooter { get; set; }

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

C#
public SummariesOption SummariesExportOption { get; set; }
Property Value:

The summaries export option.

Methods

Cancels current export operation.

C#
public void CancelExport()

Cancels an asynchronous export operation.

C#
public void CancelExportAsync()

Removes the temporary sparkline element from the grid and disposes it and its series when attached.

C#
protected virtual void DetachSparkElemnt()

Exports the footer part of the page.

C#
protected virtual void DrawFooter()

Exports the header part of the page.

C#
protected virtual void DrawHeader()

Counts pages using the configured layout and child-view options; width-fit mode returns only the vertical page count.

C#
public int GetNumberOfPages(ExportGridTraverser traverser)
Parameters:traverserExportGridTraverser

The row traverser to use; it is reset before counting and again on normal completion.

Returns:

int

The number of pages required by the current export settings.

Gets the row size using the provided row layout.

C#
protected virtual Size GetRowSize(GridViewRowInfo row, TableViewRowLayoutBase rowLayout)
Parameters:rowGridViewRowInfo

The row to measure.

rowLayoutTableViewRowLayoutBase

The row layout to be used for the measure.

Returns:

Size

The size of the row.

Raises the event.

C#
protected virtual void OnAsyncExportCompleted(AsyncCompletedEventArgs e)
Parameters:eAsyncCompletedEventArgs

The AsyncCompletedEventArgs instance containing the event data.

Raises the event.

C#
protected virtual void OnAsyncExportProgressChanged(ProgressChangedEventArgs e)
Parameters:eProgressChangedEventArgs

The ProgressChangedEventArgs instance containing the event data.

Raises the event.

C#
protected virtual void OnCellFormatting(PdfExportCellFormattingEventArgs e)
Parameters:ePdfExportCellFormattingEventArgs

The PdfExportCellFormattingEventArgs instance containing the event data.

Raises the event.

C#
protected virtual void OnCellPaint(ExportCellPaintEventArgs e)
Parameters:eExportCellPaintEventArgs

The ExportCellPaintEventArgs instance containing the event data.

Raises the event.

C#
protected virtual void OnChildViewExporting(ChildViewExportingEventArgs e)
Parameters:eChildViewExportingEventArgs

The ChildViewExportingEventArgs instance containing the event data.

Raises the event.

C#
protected virtual void OnFooterExported(ExportEventArgs e)
Parameters:eExportEventArgs

The ExportEventArgs instance containing the event data.

Raises the event.

C#
protected virtual void OnHeaderExported(ExportEventArgs e)
Parameters:eExportEventArgs

The ExportEventArgs instance containing the event data.

Raises the event.

C#
protected virtual void OnPdfExported(EventArgs e)
Parameters:eEventArgs

The EventArgs instance containing the event data.

Parses a given string for special words.

C#
protected string ParseHeaderFooterString(string s)
Parameters:sstring

The string.

Returns:

string

The parsed string.

Starts an export operation.

C#
public void RunExport(Stream exportStream, IPdfExportRenderer exportRenderer)
Parameters:exportStreamStream

The Stream where the RadGridView will be exported.

exportRendererIPdfExportRenderer

Instance of IPdfExportRenderer class.

Starts an export operation.

C#
public void RunExport(string fileName, IPdfExportRenderer pdfExportRenderer)
Parameters:fileNamestring

The file name where data will be exported.

pdfExportRendererIPdfExportRenderer

.

Starts an export operation that runs in a background thread.

C#
public void RunExportAsync(Stream exportStream, IPdfExportRenderer exportRenderer)
Parameters:exportStreamStream

The stream where data will be exported.

exportRendererIPdfExportRenderer

Instance of IPdfExportRenderer class.

Starts an export operation that runs in a background thread.

C#
public void RunExportAsync(string fileName, IPdfExportRenderer exportRenderer)
Parameters:fileNamestring

The file name where data will be exported.

exportRendererIPdfExportRenderer

Instance of IPdfExportRenderer class.

Events

Occurs when an async export operation is completed.

C#
public event AsyncCompletedEventHandler AsyncExportCompleted

Occurs when the progress of an async export operation changes.

C#
public event ProgressChangedEventHandler AsyncExportProgressChanged

Occurs for every cell that is being exported.

C#
public event PdfExportCellFormattingEventHandler CellFormatting

Occurs when a cell is drawn.

C#
public event ExportCellPaintEventHandler CellPaint

Occurs when a child view will be exported.

C#
public event ChildViewExportingEventHandler ChildViewExporting

Occurs when the footer is exported.

C#
public event ExportEventHandler FooterExported

Occurs when the header is exported.

C#
public event ExportEventHandler HeaderExported

Occurs when the export process completes.

C#
public event EventHandler PdfExported
In this article
DefinitionConstructorsGridViewPdfExport(RadGridView)FieldsDateExportedStringLogoStringPageNumberStringTimeExportedStringTotalPagesStringUserNameExportedStringPropertiesChildViewExportModeExportGroupedColumnsExportHeaderRowOnEachPageExportHierarchyExportSettingsExportViewDefinitionExportVisualSettingsFileExtensionFitToPageWidthFooterFontFooterHeightHeaderFontHeaderHeightHiddenColumnOptionHiddenRowOptionLeftFooterLeftHeaderLogoAlignmentLogoLayoutMiddleFooterMiddleHeaderPageMarginsPageSizePagingExportOptionRadGridViewToExportReverseFooterOnEvenPagesReverseHeaderOnEvenPagesRightFooterRightHeaderRowIndentScaleShowHeaderAndFooterSummariesExportOptionMethodsCancelExport()CancelExportAsync()DetachSparkElemnt()DrawFooter()DrawHeader()GetNumberOfPages(ExportGridTraverser)GetRowSize(GridViewRowInfo, TableViewRowLayoutBase)OnAsyncExportCompleted(AsyncCompletedEventArgs)OnAsyncExportProgressChanged(ProgressChangedEventArgs)OnCellFormatting(PdfExportCellFormattingEventArgs)OnCellPaint(ExportCellPaintEventArgs)OnChildViewExporting(ChildViewExportingEventArgs)OnFooterExported(ExportEventArgs)OnHeaderExported(ExportEventArgs)OnPdfExported(EventArgs)ParseHeaderFooterString(string)RunExport(Stream, IPdfExportRenderer)RunExport(string, IPdfExportRenderer)RunExportAsync(Stream, IPdfExportRenderer)RunExportAsync(string, IPdfExportRenderer)EventsAsyncExportCompletedAsyncExportProgressChangedCellFormattingCellPaintChildViewExportingFooterExportedHeaderExportedPdfExported
Not finding the help you need?
Contact Support