PrintManager
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:
public class PrintManager : IPrintable
Inheritance: objectPrintManager
Implements:
Constructors
Initializes a manager with the presenter used to render pages and the Spreadsheet element to print.
public PrintManager(WorksheetPrintPresenter presenter, RadSpreadsheetElement spreadsheet)
Presenter used to create worksheet print pages.
spreadsheetRadSpreadsheetElementSpreadsheet element associated with the print manager.
Properties
Gets the presenter that creates the page visuals used for printing and preview.
public WorksheetPrintPresenter Presenter { get; }
Gets the Spreadsheet element whose content this manager prints.
public RadSpreadsheetElement Spreadsheet { get; }
Methods
Creates a print dialog that disables print-to-file, current-page, selection, and page-range options.
protected virtual PrintDialog CreatePrintDialog()
The configured print dialog.
Resets the worksheet presenter after printing or preview rendering completes.
public void OnAfterPrint()
Initializes the worksheet presenter before page content is printed or previewed.
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.
protected virtual void OnShowPrintDialog(PrintDialog printDialog, RadPrintDocument printDocument)
Dialog used to configure and confirm printing.
printDocumentRadPrintDocumentDocument to print after confirmation.
Prints the supplied document after showing a print dialog created by CreatePrintDialog().
protected void Print(RadPrintDocument printDocument, string printDescription = null)
Document to print.
printDescriptionstringOptional description passed through the print pipeline; the current implementation does not apply it to the print document.
Exceptions: PrintingExceptionThe document has no printable pages.
Prints the active sheet, entire workbook, or current selection after showing the supplied dialog.
public void Print(RadSpreadsheetElement radSpreadsheet, PrintWhatSettings printWhatSettings, PrintDialog printDialog, string printDescription = null)
Spreadsheet element that supplies the active editor and workbook.
printWhatSettingsPrintWhatSettingsPrint scope and print-area options.
printDialogPrintDialogDialog shown before printing.
printDescriptionstringOptional description passed through the print pipeline; the current implementation does not apply it to the print document.
Exceptions: PrintingExceptionThe requested print scope produces no printable pages.
Prints the active sheet, entire workbook, or current selection according to printWhatSettings.
public void Print(RadSpreadsheetElement radSpreadsheet, PrintWhatSettings printWhatSettings, string printDescription = null, bool showDialog = true)
Spreadsheet element that supplies the active editor and workbook.
printWhatSettingsPrintWhatSettingsPrint scope and print-area options.
printDescriptionstringOptional description passed through the print pipeline; the current implementation does not apply it to the print document.
showDialogbooltrue to show a print dialog; otherwise, print directly.
Exceptions: PrintingExceptionThe requested print scope produces no printable pages.
Prints the cell ranges in a selection after showing the supplied print dialog.
public void Print(Selection selection, PrintDialog printDialog, string printDescription = null)
Selection whose worksheet and cell ranges are printed.
printDialogPrintDialogDialog shown before printing.
printDescriptionstringOptional description passed through the print pipeline; the current implementation does not apply it to the print document.
Exceptions: PrintingExceptionThe selected ranges produce no printable pages.
Prints the cell ranges in the selection using a print dialog.
public void Print(Selection selection, string printDescription = null)
Selection whose worksheet and cell ranges are printed.
printDescriptionstringOptional description passed through the print pipeline; the current implementation does not apply it to the print document.
Exceptions: PrintingExceptionThe selected ranges produce no printable pages.
Prints the workbook's worksheets, optionally including content outside print areas and hidden worksheets.
public void Print(Workbook workbook, bool ignorePrintArea, bool includeHiddenSheets = false, string printDescription = null)
Workbook to print.
ignorePrintAreabooltrue to include content outside each worksheet's print area.
includeHiddenSheetsbooltrue to include hidden worksheets.
printDescriptionstringOptional description passed through the print pipeline; the current implementation does not apply it to the print document.
Exceptions: PrintingExceptionThe workbook produces no printable pages.
Prints a workbook after showing the supplied dialog, with optional print-area and hidden-sheet handling.
public void Print(Workbook workbook, bool ignorePrintAreas, PrintDialog printDialog, bool includeHiddenSheets = false, string printDescription = null)
Workbook to print.
ignorePrintAreasbooltrue to include content outside each worksheet's print area.
printDialogPrintDialogDialog shown before printing.
includeHiddenSheetsbooltrue to include hidden worksheets.
printDescriptionstringOptional description passed through the print pipeline; the current implementation does not apply it to the print document.
Exceptions: PrintingExceptionThe workbook produces no printable pages.
Prints a worksheet, optionally including content outside its print area, after showing the supplied dialog.
public void Print(Worksheet worksheet, bool ignorePrintArea, PrintDialog printDialog, string printDescription = null)
Worksheet to print.
ignorePrintAreabooltrue to include content outside the worksheet's print area.
printDialogPrintDialogDialog shown before printing.
printDescriptionstringOptional description passed through the print pipeline; the current implementation does not apply it to the print document.
Exceptions: PrintingExceptionThe worksheet produces no printable pages.
Prints a worksheet, optionally including cells outside its defined print area.
public void Print(Worksheet worksheet, bool ignorePrintArea, string printDescription = null)
Worksheet to print.
ignorePrintAreabooltrue to include content outside the worksheet's print area.
printDescriptionstringOptional description passed through the print pipeline; the current implementation does not apply it to the print document.
Exceptions: PrintingExceptionThe worksheet produces no printable pages.
Prints the specified cell ranges after showing the supplied print dialog.
public void Print(Worksheet worksheet, IEnumerable<CellRange> selectedRanges, PrintDialog printDialog, string printDescription = null)
Worksheet containing the ranges.
selectedRangesIEnumerable<CellRange>Cell ranges to include in the print layout.
printDialogPrintDialogDialog shown before printing.
printDescriptionstringOptional description passed through the print pipeline; the current implementation does not apply it to the print document.
Exceptions: PrintingExceptionThe specified ranges produce no printable pages.
Prints the specified cell ranges from one worksheet.
public void Print(Worksheet worksheet, IEnumerable<CellRange> selectedRanges, string printDescription = null, bool showDialog = true)
Worksheet containing the ranges.
selectedRangesIEnumerable<CellRange>Cell ranges to include in the print layout.
printDescriptionstringOptional description passed through the print pipeline; the current implementation does not apply it to the print document.
showDialogbooltrue to show a print dialog; otherwise, print directly.
Exceptions: PrintingExceptionThe specified ranges produce no printable pages.
Opens the modal preview dialog using the Spreadsheet control's theme when available.
public void PrintPreview()