Prints a report document using the specified printer settings and output format.

Namespace:  Telerik.Reporting.Processing
Assembly:  Telerik.Reporting (in Telerik.Reporting.dll)


public void PrintReport(
	ReportSource reportSource,
	PrinterSettings printerSettings,
	string outputFormat,
	CancellationToken cancellationToken


Type: Telerik.ReportingReportSource
Specifies the ReportSource for the report document to print.
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.
Type: SystemString
Specifies the output format to be used when printing the document. If not specified, the EMF format will be used.
Type: System.ThreadingCancellationToken
Specifies the CancellationToken instance that could be used to cancel the report rendering.


To prevent the Print Dialog from appearing, you should specify valid printer settings to this method.


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

See Also

In this article
Not finding the help you need?