[]
Manages and applies printer settings for printing reports in ActiveReports.
public sealed class PrinterSettings : IDisposable
<p>The <xref href="GrapeCity.ActiveReports.PrinterSettings" data-throw-if-not-resolved="false"></xref> class provides a comprehensive interface for configuring printer settings specific to the needs of printing reports
generated by ActiveReports. It includes options for selecting printers, defining print options, and controlling the print dialog and progress dialog visibility.
This class also supports disposing of resources, making it critical to ensure proper resource management, especially in applications that create multiple instances for different print jobs.
Instances of this class can be created directly for default printing scenarios or can be initialized with specific reports, printers, and print options for customized printing workflows.
This example demonstrates how to create a PrinterSettings instance and configure it for printing a report:
// Load the report
var reportPath = @"C:\path\to\your\report\SalesReport.rdlx";
var report = new GrapeCity.ActiveReports.PageReport(new System.IO.FileInfo(reportPath));
// Create a new instance of PrinterSettings for the specific report
var printerSettings = new GrapeCity.ActiveReports.PrinterSettings(report.Report);
// Configure printer settings
printerSettings.ShowPrintDialog = true;
// Print the report
// Note: Actual printing code would go here, using the configured printerSettings
Name | Description |
---|---|
PrinterSettings() | Creates a new instance of PrinterSettings with default print options. |
PrinterSettings(Report, string) | Creates a new instance of PrinterSettings for a specific report. |
PrinterSettings(Printer, PrintOptions) | Creates a new instance of PrinterSettings with a specific printer and print options. |
Name | Description |
---|---|
PrintOptions | Gets the PrintOptions instance associated with this printer settings. |
Printer | Gets the printer instance. |
ShowPrintDialog | Gets or sets a value indicating whether the print dialog is displayed before the printing process starts. |
ShowPrintProgressDialog | Gets or sets a value indicating whether the print progress dialog is displayed during the printing process. |
UsePrintingThread | Gets or sets a value indicating whether the printing process should be executed on a separate thread. |
UseStandardDialog | Gets or sets a value indicating whether the standard print dialog should be used. |
UseXpDialog | Gets or sets a value indicating whether the XP style print dialog should be used. |
Name | Description |
---|---|
Dispose() | Disposes the printer settings and associated resources. |
Name | Description |
---|---|
PrintAborted | Occurs when the printing process is aborted. |
PrintProgress | Occurs when there is a change in the printing progress. |
PrintingThreadErrorEvent | Occurs when an unhandled exception is thrown in the printing thread. |