Progress® Telerik® Reporting R1 2021
ReportProcessor.PrintReport Method (ReportSource, PrinterSettings, CancellationToken)
Prints a report document using the specified printer settings.
Namespace:
Telerik.Reporting.ProcessingAssembly: Telerik.Reporting (in Telerik.Reporting.dll)
Syntax
public void PrintReport( ReportSource reportSource, PrinterSettings printerSettings, CancellationToken cancellationToken )
Parameters
- reportSource
- Type: Telerik.ReportingReportSource
Specifies the ReportSource for the report document to print. - printerSettings
- Type: System.Drawing.PrintingPrinterSettings
Specifies the printer settings to be used when printing the document. If null or invalid settings are specified, the Print Dialog appears. - cancellationToken
- Type: System.ThreadingCancellationToken
Specifies the CancellationToken instance that could be used to cancel the report rendering.
Remarks
To prevent the Print Dialog from appearing, you should specify valid
printer settings to this method.
Examples
This example illustrates how to prevent the standard Print Dialog from
appearing in a batch print operation or when printing from a service.
var reportName = "Telerik.Reporting.Examples.CSharp.Dashboard, CSharp.ReportLibrary"; // Obtain the settings of the default printer System.Drawing.Printing.PrinterSettings printerSettings = new System.Drawing.Printing.PrinterSettings(); // The standard print controller comes with no UI System.Drawing.Printing.PrintController standardPrintController = new System.Drawing.Printing.StandardPrintController(); // Print the report using the custom print controller Telerik.Reporting.Processing.ReportProcessor reportProcessor = new Telerik.Reporting.Processing.ReportProcessor(); reportProcessor.PrintController = standardPrintController; Telerik.Reporting.TypeReportSource typeReportSource = new Telerik.Reporting.TypeReportSource(); // reportName is the Assembly Qualified Name of the report typeReportSource.TypeName = reportName; System.Threading.CancellationTokenSource cancellationTokenSource = new System.Threading.CancellationTokenSource(); reportProcessor.PrintReport(typeReportSource, printerSettings, cancellationTokenSource.Token);
Version Information
Supported in: 1.0.1