[]
Creates a new instance of PrinterSettings with default print options.
public PrinterSettings()
Creates a new instance of PrinterSettings for a specific report.
public PrinterSettings(Report report, string reportName = null)
Type | Name | Description |
---|---|---|
Report | report | The report to print. |
string | reportName | The name of the report. |
// Load the report
var reportPath = @"C:\path\to\your\report\SalesReport.rdlx";
var report = new GrapeCity.ActiveReports.PageReport(new System.IO.FileInfo(reportPath));
// Optionally, specify a custom name for the print job
string reportName = "Monthly Sales Report";
// Create a new instance of PrinterSettings for the specific report
var printerSettings = new GrapeCity.ActiveReports.PrinterSettings(report.Report, reportName);
// Configure additional printer settings as needed
printerSettings.ShowPrintDialog = true;
printerSettings.ShowPrintProgressDialog = true;
printerSettings.UsePrintingThread = true;
// Example: Print the report
// Note: Actual printing code would go here, using the configured printerSettings
Creates a new instance of PrinterSettings with a specific printer and print options.
public PrinterSettings(Printer printer, PrintOptions printOptions)
Type | Name | Description |
---|---|---|
Printer | printer | The printer instance. |
PrintOptions | printOptions | The print options. |
// Instantiate and configure a Printer object
var printer = new GrapeCity.ActiveReports.Win.Printing.Printer()
{
PrinterName = "YourPrinterName", // Specify the printer name
Landscape = true, // Set landscape orientation
// Additional printer configuration can be done here
};
// Configure custom print options
var printOptions = GrapeCity.ActiveReports.Printing.PrintOptions.CreateDefault();
printOptions.PageOrder = PageOrder.Vertical;
printOptions.PagesPerSheet = 2;
// Create a new instance of PrinterSettings with the custom printer and print options
var printerSettings = new GrapeCity.ActiveReports.PrinterSettings(printer, printOptions);
// Example: Use the configured printerSettings for printing
// Note: Actual printing code would go here, using the configured printerSettings