Class GridViewPdfExport
GridViewPdfExport is an exporting API, allowing to export RadGridView to PDF format, utilizing the Document Processing Libraries.
Inheritance
Inherited Members
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
|
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
FooterHeight
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
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
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
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
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
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()
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)
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)
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
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
|