Progress® Telerik® Reporting R3 2017

ReportProcessorPrintReport Method

Prints a report document using the specified printer settings.

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

Syntax

public void PrintReport(
	ReportSource reportSource,
	PrinterSettings printerSettings
)

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.

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;

reportProcessor.PrintReport(typeReportSource, printerSettings);

See Also