Class ReportProcessor
Represents the object responsible for printing and rendering Reports.
Inheritance
Namespace: Telerik.Reporting.Processing
Assembly: Telerik.Reporting.dll
Syntax
public sealed class ReportProcessor
Constructors
ReportProcessor()
Initializes a new instance of the ReportProcessor class.
Declaration
public ReportProcessor()
Properties
PrintController
Specifies a print controller to be used when printing a Report. If a null value is specified, a default print controller is used, which displays the Print Progress dialog.
Declaration
public PrintController PrintController { get; set; }
Property Value
System.Drawing.Printing.PrintController
|
Remarks
If you need a better control over the printing process, or simply
to customize the appearance of the print UI, you should specify
a custom print controller to this method.
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();
// Create a custom print controller based on the StandardPrintController with title: Print Progress
System.Drawing.Printing.PrintController standardPrintController =
new System.Drawing.Printing.StandardPrintController();
System.Drawing.Printing.PrintController customPrintController =
new System.Windows.Forms.PrintControllerWithStatusDialog(standardPrintController, "Print Progress");
// Print the report using the custom print controller
Telerik.Reporting.Processing.ReportProcessor reportProcessor =
new Telerik.Reporting.Processing.ReportProcessor();
reportProcessor.PrintController = customPrintController;
Telerik.Reporting.TypeReportSource typeReportSource =
new Telerik.Reporting.TypeReportSource();
// reportName is the Assembly Qualified Name of the report
typeReportSource.TypeName = reportName;
reportProcessor.PrintReport(typeReportSource, printerSettings);
Dim reportName = "ReportCatalog, VB.ReportLibrary"
' Obtain the settings of the default printer
Dim printerSettings As New System.Drawing.Printing.PrinterSettings
' Create a custom print controller based on the StandardPrintController with title: Print Progress
Dim standardPrintController As New System.Drawing.Printing.StandardPrintController
Dim customPrintController As New System.Windows.Forms.PrintControllerWithStatusDialog(standardPrintController, "Print Progress")
' Create a report source to pass the report to the report processor
Dim typeReportSource As New Telerik.Reporting.TypeReportSource()
' reportName is the Assembly Qualified Name of the report
typeReportSource.TypeName = reportName
' Print the report using the custom print controller
Dim reportProcessor As New Telerik.Reporting.Processing.ReportProcessor
reportProcessor.PrintController = customPrintController
reportProcessor.PrintReport(typeReportSource, printerSettings)
Methods
Print(IReportDocument, PrinterSettings)
Prints a report document using the specified printer settings.
Declaration
[Obsolete("The static (Shared) ReportProcessor.Print method is now obsolete. Please create an instance of the ReportProcessor class and use the PrintReport method.")]
public static void Print(IReportDocument reportDocument, PrinterSettings printerSettings)
Parameters
IReportDocument
reportDocument
Specifies an instance of a report document to print. Both Report and ReportBook documents are supported. |
System.Drawing.Printing.PrinterSettings
printerSettings
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.
// Create an instance of the report to print.
IReportDocument reportDocument = new MyReport();
// Obtain the settings of the default printer.
PrinterSettings printerSettings = new PrinterSettings();
// Adjust the printer settings if necessary...
// Print the report using the printer settings.
ReportProcessor.Print(reportDocument, printerSettings);
' Create an instance of the report to print.
Dim reportDocument As IReportDocument = New MyReport()
' Obtain the settings of the default printer.
Dim printerSettings As New PrinterSettings()
' Adjust the printer settings if necessary...
' Print the report using the printer settings.
ReportProcessor.Print(reportDocument, printerSettings)
PrintReport(ReportSource, PrinterSettings)
Prints a report document using the specified printer settings.
Declaration
public void PrintReport(ReportSource reportSource, PrinterSettings printerSettings)
Parameters
ReportSource
reportSource
Specifies the ReportSource for the report document print. |
System.Drawing.Printing.PrinterSettings
printerSettings
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.
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);
Dim reportName = "ReportCatalog, VB.ReportLibrary"
' 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 a report source to pass the report to the report processor
Dim typeReportSource As New Telerik.Reporting.TypeReportSource()
' reportName is the Assembly Qualified Name of the report
typeReportSource.TypeName = reportName
' Print the report using the custom print controller
Dim reportProcessor As New Telerik.Reporting.Processing.ReportProcessor
reportProcessor.PrintController = standardPrintController
reportProcessor.PrintReport(typeReportSource, printerSettings)
PrintReport(ReportSource, PrinterSettings, String)
Prints a report document using the specified printer settings and output format.
Declaration
public void PrintReport(ReportSource reportSource, PrinterSettings printerSettings, string outputFormat)
Parameters
ReportSource
reportSource
Specifies the ReportSource for the report document to print. |
System.Drawing.Printing.PrinterSettings
printerSettings
Specifies the printer settings to be used when printing the document. If null or invalid settings are specified, the Print Dialog appears. |
System.String
outputFormat
Specifies the output format to be used when printing the document. If not specified, the EMF format will be used. |
Remarks
To prevent the Print Dialog from appearing, you should specify valid
printer settings to this method.
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;
string outputFormat = "PNG";
reportProcessor.PrintReport(typeReportSource, printerSettings, outputFormat);
Dim reportName = "ReportCatalog, VB.ReportLibrary"
' 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 a report source to pass the report to the report processor
Dim typeReportSource As New Telerik.Reporting.TypeReportSource()
' reportName is the Assembly Qualified Name of the report
typeReportSource.TypeName = reportName
Dim outputFormat As String = "PNG"
' Print the report using the custom print controller
Dim reportProcessor As New Telerik.Reporting.Processing.ReportProcessor
reportProcessor.PrintController = standardPrintController
reportProcessor.PrintReport(typeReportSource, printerSettings, outputFormat)
PrintReport(ReportSource, PrinterSettings, String, CancellationToken)
Prints a report document using the specified printer settings and output format.
Declaration
public void PrintReport(ReportSource reportSource, PrinterSettings printerSettings, string outputFormat, CancellationToken cancellationToken)
Parameters
ReportSource
reportSource
Specifies the ReportSource for the report document to print. |
System.Drawing.Printing.PrinterSettings
printerSettings
Specifies the printer settings to be used when printing the document. If null or invalid settings are specified, the Print Dialog appears. |
System.String
outputFormat
Specifies the output format to be used when printing the document. If not specified, the EMF format will be used. |
System.Threading.CancellationToken
cancellationToken
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.
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;
string outputFormat = "PNG";
System.Threading.CancellationTokenSource cancellationTokenSource =
new System.Threading.CancellationTokenSource();
reportProcessor.PrintReport(typeReportSource, printerSettings, outputFormat, cancellationTokenSource.Token);
Dim reportName = "ReportCatalog, VB.ReportLibrary"
' 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 a report source to pass the report to the report processor
Dim typeReportSource As New Telerik.Reporting.TypeReportSource()
' reportName is the Assembly Qualified Name of the report
typeReportSource.TypeName = reportName
Dim outputFormat As String = "PNG"
Dim cancellationTokenSource As New System.Threading.CancellationTokenSource()
' Print the report using the custom print controller
Dim reportProcessor As New Telerik.Reporting.Processing.ReportProcessor
reportProcessor.PrintController = standardPrintController
reportProcessor.PrintReport(typeReportSource, printerSettings, outputFormat, cancellationTokenSource.Token)
PrintReport(ReportSource, PrinterSettings, CancellationToken)
Prints a report document using the specified printer settings.
Declaration
public void PrintReport(ReportSource reportSource, PrinterSettings printerSettings, CancellationToken cancellationToken)
Parameters
ReportSource
reportSource
Specifies the ReportSource for the report document to print. |
System.Drawing.Printing.PrinterSettings
printerSettings
Specifies the printer settings to be used when printing the document. If null or invalid settings are specified, the Print Dialog appears. |
System.Threading.CancellationToken
cancellationToken
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.
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);
Dim reportName = "ReportCatalog, VB.ReportLibrary"
' 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 a report source to pass the report to the report processor
Dim typeReportSource As New Telerik.Reporting.TypeReportSource()
' reportName is the Assembly Qualified Name of the report
typeReportSource.TypeName = reportName
Dim cancellationTokenSource As New System.Threading.CancellationTokenSource()
' Print the report using the custom print controller
Dim reportProcessor As New Telerik.Reporting.Processing.ReportProcessor
reportProcessor.PrintController = standardPrintController
reportProcessor.PrintReport(typeReportSource, printerSettings, cancellationTokenSource.Token)
Render(String, IReportDocument, Hashtable, out String, out String, out String, out Encoding)
Renders a report in the specified format
Declaration
[Obsolete("The static (Shared) ReportProcessor.Render method is now obsolete. Please create an instance of the ReportProcessor class and use the RenderReport method.")]
public static byte[] Render(string format, IReportDocument report, Hashtable deviceInfo, out string mimeType, out string documentName, out string extension, out Encoding encoding)
Parameters
System.String
format
Export format |
IReportDocument
report
Report document to render. |
System.Collections.Hashtable
deviceInfo
Contains parameters to pass to the rendering extension. |
System.String
mimeType
The MIME type of the result buffer. |
System.String
documentName
The name of the created document. |
System.String
extension
The file extension of the result buffer. |
System.Text.Encoding
encoding
The character encoding of the result buffer. |
Returns
System.Byte[]
Byte array that contains the rendered report. |
Render(String, IReportDocument, Hashtable, out String, out String, out Encoding)
Renders a report in the specified format
Declaration
[Obsolete("The static (Shared) ReportProcessor.Render method is now obsolete. Please create an instance of the ReportProcessor class and use the RenderReport method.")]
public static byte[] Render(string format, IReportDocument report, Hashtable deviceInfo, out string mimeType, out string extension, out Encoding encoding)
Parameters
System.String
format
Export format |
IReportDocument
report
Report document to render. |
System.Collections.Hashtable
deviceInfo
Contains parameters to pass to the rendering extension. |
System.String
mimeType
The MIME type of the result buffer. |
System.String
extension
The file extension of the result buffer. |
System.Text.Encoding
encoding
The character encoding of the result buffer. |
Returns
System.Byte[]
Byte array that contains the rendered report. |
Render(String, IReportDocument, Hashtable, CreateStream)
Renders a report in the specified format
Declaration
[Obsolete("The static (Shared) ReportProcessor.Render method is now obsolete. Please create an instance of the ReportProcessor class and use the RenderReport method.")]
public static bool Render(string format, IReportDocument report, Hashtable deviceInfo, CreateStream createStreamCallback)
Parameters
System.String
format
Export format |
IReportDocument
report
Report document to render |
System.Collections.Hashtable
deviceInfo
Contains parameters to pass to the rendering extension. |
CreateStream
createStreamCallback
The delegate function to call to get a stream to render into. |
Returns
System.Boolean
True if the rendering succeeds. |
Render(String, IReportDocument, Hashtable, CreateStream, out String)
Renders a report in the specified format
Declaration
[Obsolete("The static (Shared) ReportProcessor.Render method is now obsolete. Please create an instance of the ReportProcessor class and use the RenderReport method.")]
public static bool Render(string format, IReportDocument reportDocument, Hashtable deviceInfo, CreateStream createStreamCallback, out string documentName)
Parameters
System.String
format
Export format |
IReportDocument
reportDocument
Report document to render |
System.Collections.Hashtable
deviceInfo
Contains parameters to pass to the rendering extension. |
CreateStream
createStreamCallback
The delegate function to call to get a stream to render into. |
System.String
documentName
The name of the created document. |
Returns
System.Boolean
True if the rendering succeeds. |
RenderReport(String, ReportSource, Hashtable)
Renders a report in the specified format.
Declaration
public RenderingResult RenderReport(string format, ReportSource reportSource, Hashtable deviceInfo)
Parameters
System.String
format
Export format. See Rendering Extensions help article for available export formats. |
ReportSource
reportSource
The ReportSource for the report document to render. |
System.Collections.Hashtable
deviceInfo
Contains parameters to pass to the rendering extension. |
Returns
RenderingResult
|
RenderReport(String, ReportSource, Hashtable, CancellationToken)
Renders a report in the specified format.
Declaration
public RenderingResult RenderReport(string format, ReportSource reportSource, Hashtable deviceInfo, CancellationToken cancellationToken)
Parameters
System.String
format
Export format. See Rendering Extensions help article for available export formats. |
ReportSource
reportSource
The ReportSource for the report document to render. |
System.Collections.Hashtable
deviceInfo
Contains parameters to pass to the rendering extension. |
System.Threading.CancellationToken
cancellationToken
A CancellationToken instance that allows to cancel the current rendering. |
Returns
RenderingResult
|
RenderReport(String, ReportSource, Hashtable, CreateStream, out String)
Renders a report in the specified format.
Declaration
public bool RenderReport(string format, ReportSource reportSource, Hashtable deviceInfo, CreateStream createStreamCallback, out string documentName)
Parameters
System.String
format
Export format. See Rendering Extensions help article for available export formats. |
ReportSource
reportSource
The ReportSource for the report document to render. |
System.Collections.Hashtable
deviceInfo
Contains parameters to pass to the rendering extension. |
CreateStream
createStreamCallback
The delegate function to call to get a stream to render into. |
System.String
documentName
The name of the created document. |
Returns
System.Boolean
True if the rendering succeeds. |
RenderReport(String, ReportSource, Hashtable, CreateStream, CancellationToken, out String)
Renders a report in the specified format.
Declaration
public bool RenderReport(string format, ReportSource reportSource, Hashtable deviceInfo, CreateStream createStreamCallback, CancellationToken cancellationToken, out string documentName)
Parameters
System.String
format
Export format. See Rendering Extensions help article for available export formats. |
ReportSource
reportSource
The ReportSource for the report document to render. |
System.Collections.Hashtable
deviceInfo
Contains parameters to pass to the rendering extension. |
CreateStream
createStreamCallback
The delegate function to call to get a stream to render into. |
System.Threading.CancellationToken
cancellationToken
A CancellationToken instance that allows to cancel the current rendering. |
System.String
documentName
The name of the created document. |
Returns
System.Boolean
True if the rendering succeeds. |
Events
Error
Occurs when a processing exception is raised.
Declaration
public event ErrorEventHandler Error
Event Type
ErrorEventHandler
|