Class PrintSettings
This class contains the printer settings. It is used in the FastReport.Report.PrintSettings property.
Inheritance
Namespace: FastReport
Assembly: FastReport.dll
Syntax
[TypeConverter(typeof(FRExpandableObjectConverter))]
public class PrintSettings : IDisposable
Remarks
Typical use of this class is to setup a printer properties without using the "Print" dialog. In this case, setup necessary properties and turn off the dialog via the ShowDialog property.
Constructors
PrintSettings()
Initializes a new instance of the PrintSettings class with default settings.
Declaration
public PrintSettings()
Properties
AutoPaperSize
Gets or sets the value indicating whether the use paper size from properties of report page.
Declaration
public bool AutoPaperSize { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Collate
Gets or sets a value indicating whether the printed document should be collated.
Declaration
public bool Collate { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Copies
Gets or sets the number of copies to print.
Declaration
public int Copies { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
CopyNames
Gets or sets an array of printed copy names, such as "Original", "Copy", etc.
Declaration
public string[] CopyNames { get; set; }
Property Value
Type | Description |
---|---|
System.String[] |
Duplex
Gets or sets the duplex mode.
Declaration
public Duplex Duplex { get; set; }
Property Value
Type | Description |
---|---|
System.Drawing.Printing.Duplex |
PageNumbers
Gets or sets the page number(s) to print.
Declaration
public string PageNumbers { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Remarks
This property is used if PageRange property is set to PageNumbers. You can specify the page numbers, separated by commas, or the page ranges. For example: "1,3,5-12".
PageRange
Gets or sets a value specifies the page range to print.
Declaration
public PageRange PageRange { get; set; }
Property Value
Type | Description |
---|---|
PageRange |
PagesOnSheet
Gets or sets the number of pages per printed sheet.
Declaration
public PagesOnSheet PagesOnSheet { get; set; }
Property Value
Type | Description |
---|---|
PagesOnSheet |
Remarks
This property is used if the PrintMode property is set to Scale.
PaperSource
Gets or sets the paper source.
Declaration
public int PaperSource { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Remarks
This property corresponds to the RAW source number. Default value is 7 which corresponds to DMBIN_AUTO.
Printer
Gets or sets the printer name.
Declaration
[TypeConverter(typeof(PrinterConverter))]
public string Printer { get; set; }
Property Value
Type | Description |
---|---|
System.String |
PrintMode
Gets or sets the print mode.
Declaration
public PrintMode PrintMode { get; set; }
Property Value
Type | Description |
---|---|
PrintMode |
Remarks
See the PrintMode enumeration for details. If you use the mode other than Default, you must specify the sheet size in the PrintOnSheetWidth, PrintOnSheetHeight properties.
PrintOnSheetHeight
Gets or sets the height of the paper sheet to print on.
Declaration
public float PrintOnSheetHeight { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
Remarks
This property is used if the PrintMode property is not Default. Specify the paper height in millimeters.
PrintOnSheetRawPaperSize
Gets or sets the raw index of a paper size.
Declaration
public int PrintOnSheetRawPaperSize { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
PrintOnSheetWidth
Gets or sets the width of the paper sheet to print on.
Declaration
public float PrintOnSheetWidth { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
Remarks
This property is used if the PrintMode property is not Default. Specify the paper width in millimeters.
PrintPages
Gets or sets a value specifies the pages to print.
Declaration
public PrintPages PrintPages { get; set; }
Property Value
Type | Description |
---|---|
PrintPages |
PrintToFile
Gets or sets a value indicating that the printing output should be send to a file instead of a printer.
Declaration
public bool PrintToFile { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Remarks
Also set the PrintToFileName property.
PrintToFileName
The name of a file to print the report to.
Declaration
public string PrintToFileName { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Remarks
This property is used if PrintToFile property is true.
Reverse
Gets or sets a value determines whether to print pages in reverse order.
Declaration
public bool Reverse { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
SavePrinterWithReport
Gets or sets a value indicating that the printer name should be saved in a report file.
Declaration
public bool SavePrinterWithReport { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Remarks
If this property is set to true, the printer name will be saved in a report file. Next time when you open the report, the printer will be automatically selected.
Scale
Gets or sets the scale of report page. Percentage value.
Declaration
public short Scale { get; set; }
Property Value
Type | Description |
---|---|
System.Int16 |
ShowDialog
Specifies whether to display the "Print" dialog.
Declaration
public bool ShowDialog { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Methods
Assign(PrintSettings)
Assigns values from another source.
Declaration
public void Assign(PrintSettings source)
Parameters
Type | Name | Description |
---|---|---|
PrintSettings | source | Source to assign from. |
Clear()
Resets all settings to its default values.
Declaration
public void Clear()
Dispose()
Declaration
public void Dispose()