public void PrintReport( ReportSource reportSource, PrinterSettings printerSettings )
Public Sub PrintReport ( _ reportSource As ReportSource, _ printerSettings As PrinterSettings _ )
Telerik.Reporting.IReportDocument myReport = new MyReport(); // 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.InstanceReportSource instanceReportSource = new Telerik.Reporting.InstanceReportSource(); instanceReportSource.ReportDocument = myReport; reportProcessor.PrintReport(instanceReportSource, printerSettings);
Dim report1 As New MyReport ' Obtain the settings of the default printer Dim printerSettings As New System.Drawing.Printing.PrinterSettings ' The standard print controller comes with no UI Dim standardPrintController As New System.Drawing.Printing.StandardPrintController ' Create an instance report source to pass the report to the report processor Dim instanceReportSource As New Telerik.Reporting.InstanceReportSource() instanceReportSource.ReportDocument = report1 ' Print the report using the custom print controller Dim reportProcessor As New Telerik.Reporting.Processing.ReportProcessor reportProcessor.PrintController = standardPrintController reportProcessor.PrintReport(instanceReportSource, printerSettings)