GridViewPdfExport
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:
public class GridViewPdfExport
Inheritance: objectGridViewPdfExport
Constructors
Initializes a new instance of the GridViewPdfExport class.
public GridViewPdfExport(RadGridView radGridView)
The grid to export.
Fields
Date when the exporting was started.
public const string DateExportedString = "[Date Exported]"
Allows to add logo to the header or footer.
public const string LogoString = "[Logo]"
Number of the current page
public const string PageNumberString = "[Page #]"
Time when the printing was started.
public const string TimeExportedString = "[Time Exported]"
Total number of pages
public const string TotalPagesString = "[Total Pages]"
Username associated with the current thread (the current Windows login))
public const string UserNameExportedString = "[User Name]"
Properties
Gets or sets the child view export mode.
public ChildViewExportMode ChildViewExportMode { get; set; }
The child view export mode.
Gets or sets a value indicating whether grouped columns should be exported. Default value is true.
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.
public bool ExportHeaderRowOnEachPage { get; set; }
Gets or sets if child rows should be exported.
public bool ExportHierarchy { get; set; }
Gets or sets export settings.
public PdfExportSettings ExportSettings { get; set; }
Gets or sets a value indicating whether to export view definition.
public bool ExportViewDefinition { get; set; }
Gets or sets a value indicating whether the visual settings should be exported.
public bool ExportVisualSettings { get; set; }
true if visual settings are exported; otherwise, false.
Gets or sets the file extension of the exported file.
public string FileExtension { get; set; }
The file extension.
Gets or sets a value indicating whether the content of page should fit into the page width. Default value is true.
public bool FitToPageWidth { get; set; }
Gets or sets the font of the page footer.
public Font FooterFont { get; set; }
Gets or sets the footer height.
public double FooterHeight { get; set; }
Gets or sets the font of the page header.
public Font HeaderFont { get; set; }
Gets or sets the header height.
public double HeaderHeight { get; set; }
Gets or sets a value indicating how hidden columns are exported.
public HiddenOption HiddenColumnOption { get; set; }
The hidden column option.
Gets or sets a value indicating how hidden rows are exported.
public HiddenOption HiddenRowOption { get; set; }
The hidden row option.
Gets or sets the text that will be exported near the bottom left corner of the page.
public string LeftFooter { get; set; }
Gets or sets the text that will be exported near the upper left corner of the page.
public string LeftHeader { get; set; }
Gets or sets the alignment of logo image in header/footer.
public ContentAlignment LogoAlignment { get; set; }
Gets or sets the way the logo is drawn.
public LogoLayout LogoLayout { get; set; }
Gets or sets the text that will be exported at the bottom center of the page.
public string MiddleFooter { get; set; }
Gets or sets the text that will be exported at the top center of the page.
public string MiddleHeader { get; set; }
Gets or Sets the margins of pages that will be exported in millimeters.
public Padding PageMargins { get; set; }
Gets or sets the page size in millimeters for the exported file. Default size is 210x297mm(A4 portrait).
public SizeF PageSize { get; set; }
Gets or sets a value indicating how the export behaves when paging is enabled.
public PagingExportOption PagingExportOption { get; set; }
The paging export option.
Gets or sets the RadGridView to export.
public RadGridView RadGridViewToExport { get; set; }
The RadGridView to export.
[true] if the LeftFooter and RightFooter should be reversed on even pages, [false] otherwise.
public bool ReverseFooterOnEvenPages { get; set; }
[true] if the LeftHeader and RightHeader should be reversed on even pages, [false] otherwise.
public bool ReverseHeaderOnEvenPages { get; set; }
Gets or sets the text that will be exported near the bottom right corner of the page.
public string RightFooter { get; set; }
Gets or sets the text that will be exported near the upper right corner of the page.
public string RightHeader { get; set; }
Gets or sets the indent of group and hierarchy rows.
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.
public double Scale { get; set; }
Gets or sets a value indicating whether header and footer should be exported.
public bool ShowHeaderAndFooter { get; set; }
Gets or sets a value indicating how summary rows are exported.
public SummariesOption SummariesExportOption { get; set; }
The summaries export option.
Methods
Cancels current export operation.
public void CancelExport()
Cancels an asynchronous export operation.
public void CancelExportAsync()
Removes the temporary sparkline element from the grid and disposes it and its series when attached.
protected virtual void DetachSparkElemnt()
Exports the footer part of the page.
protected virtual void DrawFooter()
Exports the header part of the page.
protected virtual void DrawHeader()
Counts pages using the configured layout and child-view options; width-fit mode returns only the vertical page count.
public int GetNumberOfPages(ExportGridTraverser traverser)
The row traverser to use; it is reset before counting and again on normal completion.
Returns:The number of pages required by the current export settings.
Gets the row size using the provided row layout.
protected virtual Size GetRowSize(GridViewRowInfo row, TableViewRowLayoutBase rowLayout)
The row to measure.
rowLayoutTableViewRowLayoutBaseThe row layout to be used for the measure.
Returns:The size of the row.
Raises the event.
protected virtual void OnAsyncExportCompleted(AsyncCompletedEventArgs e)
The AsyncCompletedEventArgs instance containing the event data.
Raises the event.
protected virtual void OnAsyncExportProgressChanged(ProgressChangedEventArgs e)
The ProgressChangedEventArgs instance containing the event data.
Raises the event.
protected virtual void OnCellFormatting(PdfExportCellFormattingEventArgs e)
The PdfExportCellFormattingEventArgs instance containing the event data.
Raises the event.
protected virtual void OnCellPaint(ExportCellPaintEventArgs e)
The ExportCellPaintEventArgs instance containing the event data.
Raises the event.
protected virtual void OnChildViewExporting(ChildViewExportingEventArgs e)
The ChildViewExportingEventArgs instance containing the event data.
Raises the event.
protected virtual void OnFooterExported(ExportEventArgs e)
The ExportEventArgs instance containing the event data.
Raises the event.
protected virtual void OnHeaderExported(ExportEventArgs e)
The ExportEventArgs instance containing the event data.
Starts an export operation.
public void RunExport(Stream exportStream, IPdfExportRenderer exportRenderer)
The Stream where the RadGridView will be exported.
exportRendererIPdfExportRendererInstance of IPdfExportRenderer class.
Starts an export operation.
public void RunExport(string fileName, IPdfExportRenderer pdfExportRenderer)
The file name where data will be exported.
pdfExportRendererIPdfExportRenderer.
Starts an export operation that runs in a background thread.
public void RunExportAsync(Stream exportStream, IPdfExportRenderer exportRenderer)
The stream where data will be exported.
exportRendererIPdfExportRendererInstance of IPdfExportRenderer class.
Starts an export operation that runs in a background thread.
public void RunExportAsync(string fileName, IPdfExportRenderer exportRenderer)
The file name where data will be exported.
exportRendererIPdfExportRendererInstance of IPdfExportRenderer class.
Events
Occurs when an async export operation is completed.
public event AsyncCompletedEventHandler AsyncExportCompleted
Occurs when the progress of an async export operation changes.
public event ProgressChangedEventHandler AsyncExportProgressChanged
Occurs for every cell that is being exported.
public event PdfExportCellFormattingEventHandler CellFormatting
Occurs when a cell is drawn.
public event ExportCellPaintEventHandler CellPaint
Occurs when a child view will be exported.
public event ChildViewExportingEventHandler ChildViewExporting
Occurs when the footer is exported.
public event ExportEventHandler FooterExported
Occurs when the header is exported.
public event ExportEventHandler HeaderExported
Occurs when the export process completes.
public event EventHandler PdfExported