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

Prepares Spreadsheet page layouts and sends worksheet, workbook, or selection content to a printer or preview.

Definition

Namespace:Telerik.WinForms.Controls.Spreadsheet

Assembly:Telerik.WinControls.RadSpreadsheet.dll

Syntax:

C#
public class PrintManager : IPrintable

Inheritance: objectPrintManager

Implements: IPrintable

Constructors

Initializes a manager with the presenter used to render pages and the Spreadsheet element to print.

C#
public PrintManager(WorksheetPrintPresenter presenter, RadSpreadsheetElement spreadsheet)
Parameters:presenterWorksheetPrintPresenter

Presenter used to create worksheet print pages.

spreadsheetRadSpreadsheetElement

Spreadsheet element associated with the print manager.

Properties

Gets the presenter that creates the page visuals used for printing and preview.

C#
public WorksheetPrintPresenter Presenter { get; }

Gets the Spreadsheet element whose content this manager prints.

C#
public RadSpreadsheetElement Spreadsheet { get; }

Methods

Creates a print dialog that disables print-to-file, current-page, selection, and page-range options.

C#
protected virtual PrintDialog CreatePrintDialog()
Returns:

PrintDialog

The configured print dialog.

Resets the worksheet presenter after printing or preview rendering completes.

C#
public void OnAfterPrint()

Initializes the worksheet presenter before page content is printed or previewed.

C#
public void OnBeforePrint()

Shows the print dialog and sends the document to the printer if the user confirms. Printing exceptions are reported through the Spreadsheet alert.

C#
protected virtual void OnShowPrintDialog(PrintDialog printDialog, RadPrintDocument printDocument)
Parameters:printDialogPrintDialog

Dialog used to configure and confirm printing.

printDocumentRadPrintDocument

Document to print after confirmation.

Prints the supplied document after showing a print dialog created by CreatePrintDialog().

C#
protected void Print(RadPrintDocument printDocument, string printDescription = null)
Parameters:printDocumentRadPrintDocument

Document to print.

printDescriptionstring

Optional description passed through the print pipeline; the current implementation does not apply it to the print document.

Exceptions: PrintingException

The document has no printable pages.

Prints the active sheet, entire workbook, or current selection after showing the supplied dialog.

C#
public void Print(RadSpreadsheetElement radSpreadsheet, PrintWhatSettings printWhatSettings, PrintDialog printDialog, string printDescription = null)
Parameters:radSpreadsheetRadSpreadsheetElement

Spreadsheet element that supplies the active editor and workbook.

printWhatSettingsPrintWhatSettings

Print scope and print-area options.

printDialogPrintDialog

Dialog shown before printing.

printDescriptionstring

Optional description passed through the print pipeline; the current implementation does not apply it to the print document.

Exceptions: PrintingException

The requested print scope produces no printable pages.

Prints the active sheet, entire workbook, or current selection according to printWhatSettings.

C#
public void Print(RadSpreadsheetElement radSpreadsheet, PrintWhatSettings printWhatSettings, string printDescription = null, bool showDialog = true)
Parameters:radSpreadsheetRadSpreadsheetElement

Spreadsheet element that supplies the active editor and workbook.

printWhatSettingsPrintWhatSettings

Print scope and print-area options.

printDescriptionstring

Optional description passed through the print pipeline; the current implementation does not apply it to the print document.

showDialogbool

true to show a print dialog; otherwise, print directly.

Exceptions: PrintingException

The requested print scope produces no printable pages.

Prints the cell ranges in a selection after showing the supplied print dialog.

C#
public void Print(Selection selection, PrintDialog printDialog, string printDescription = null)
Parameters:selectionSelection

Selection whose worksheet and cell ranges are printed.

printDialogPrintDialog

Dialog shown before printing.

printDescriptionstring

Optional description passed through the print pipeline; the current implementation does not apply it to the print document.

Exceptions: PrintingException

The selected ranges produce no printable pages.

Prints the cell ranges in the selection using a print dialog.

C#
public void Print(Selection selection, string printDescription = null)
Parameters:selectionSelection

Selection whose worksheet and cell ranges are printed.

printDescriptionstring

Optional description passed through the print pipeline; the current implementation does not apply it to the print document.

Exceptions: PrintingException

The selected ranges produce no printable pages.

Prints the workbook's worksheets, optionally including content outside print areas and hidden worksheets.

C#
public void Print(Workbook workbook, bool ignorePrintArea, bool includeHiddenSheets = false, string printDescription = null)
Parameters:workbookWorkbook

Workbook to print.

ignorePrintAreabool

true to include content outside each worksheet's print area.

includeHiddenSheetsbool

true to include hidden worksheets.

printDescriptionstring

Optional description passed through the print pipeline; the current implementation does not apply it to the print document.

Exceptions: PrintingException

The workbook produces no printable pages.

Prints a workbook after showing the supplied dialog, with optional print-area and hidden-sheet handling.

C#
public void Print(Workbook workbook, bool ignorePrintAreas, PrintDialog printDialog, bool includeHiddenSheets = false, string printDescription = null)
Parameters:workbookWorkbook

Workbook to print.

ignorePrintAreasbool

true to include content outside each worksheet's print area.

printDialogPrintDialog

Dialog shown before printing.

includeHiddenSheetsbool

true to include hidden worksheets.

printDescriptionstring

Optional description passed through the print pipeline; the current implementation does not apply it to the print document.

Exceptions: PrintingException

The workbook produces no printable pages.

Prints a worksheet, optionally including content outside its print area, after showing the supplied dialog.

C#
public void Print(Worksheet worksheet, bool ignorePrintArea, PrintDialog printDialog, string printDescription = null)
Parameters:worksheetWorksheet

Worksheet to print.

ignorePrintAreabool

true to include content outside the worksheet's print area.

printDialogPrintDialog

Dialog shown before printing.

printDescriptionstring

Optional description passed through the print pipeline; the current implementation does not apply it to the print document.

Exceptions: PrintingException

The worksheet produces no printable pages.

Prints a worksheet, optionally including cells outside its defined print area.

C#
public void Print(Worksheet worksheet, bool ignorePrintArea, string printDescription = null)
Parameters:worksheetWorksheet

Worksheet to print.

ignorePrintAreabool

true to include content outside the worksheet's print area.

printDescriptionstring

Optional description passed through the print pipeline; the current implementation does not apply it to the print document.

Exceptions: PrintingException

The worksheet produces no printable pages.

Prints the specified cell ranges after showing the supplied print dialog.

C#
public void Print(Worksheet worksheet, IEnumerable<CellRange> selectedRanges, PrintDialog printDialog, string printDescription = null)
Parameters:worksheetWorksheet

Worksheet containing the ranges.

selectedRangesIEnumerable<CellRange>

Cell ranges to include in the print layout.

printDialogPrintDialog

Dialog shown before printing.

printDescriptionstring

Optional description passed through the print pipeline; the current implementation does not apply it to the print document.

Exceptions: PrintingException

The specified ranges produce no printable pages.

Prints the specified cell ranges from one worksheet.

C#
public void Print(Worksheet worksheet, IEnumerable<CellRange> selectedRanges, string printDescription = null, bool showDialog = true)
Parameters:worksheetWorksheet

Worksheet containing the ranges.

selectedRangesIEnumerable<CellRange>

Cell ranges to include in the print layout.

printDescriptionstring

Optional description passed through the print pipeline; the current implementation does not apply it to the print document.

showDialogbool

true to show a print dialog; otherwise, print directly.

Exceptions: PrintingException

The specified ranges produce no printable pages.

Opens the modal preview dialog using the Spreadsheet control's theme when available.

C#
public void PrintPreview()