printer
An object that describes various printer output options.
Property of
Report
Description
A printer object contains properties for the following printer options:
Property |
Default |
Description |
color |
Monochrome |
Whether the output should be in color/grayscale or plain monochrome (0=Default, 1=Monochrome, 2=Color) |
copies |
1 |
Number of copies |
duplex |
None |
Whether to print in duplex, and in which orientation (0=Default, 1=None, 2=Vertical, 3=Horizontal) |
orientation |
Portrait |
The orientation of the output (0=Default, 1=Portrait, 2=Landscape) |
paperSize |
printer-dependent |
The size of the paper to use |
paperSource |
printer-dependent |
The paper tray or bin to use |
printerName |
|
The name of the target printer (blank for default printer) |
printerSource |
dBASE Plus default |
Which printerName to use (0=dBASE Plus default, 1=Windows default, 2=Specific) |
resolution |
High |
Graphics resolution (0=Default, 1=Draft, 2=Low, 3=Medium, 4=High) |
trueTypeFonts |
Depends on the currently specified default printer |
How to handle TrueType fonts (0=Default, 1=Bitmap, 2=Download, 3=Substitute, 4=Outline) |
There is only one method associated with the printer object.
Method |
Parameters |
Description |
<title expC> |
Displays Print or Print Setup dialog to allow user to choose a printer and set printing options |
Each Report object has its own printer object which controls the report output. The global _app object also has a printer object that represents the default printer.
The color property determines whether the default output should be color, greyscale, plain monochrome, or default (the printer driver's default). If you do not have a color printer attached, colors will be evaluated and printed to greyscale.
The copies property lets you set the number of copies to print.
The duplex property is used to determine whether to print in duplex mode for printers that support this option.
The orientation property is used to determine whether a report should print in portrait, or landscape mode.
The paperSize property allows you to set the paper size for the report. It uses a numeric scheme that varies based on the printer driver. Some printers support paper sizes that others do not.
For printers that support this option, the paperSource property allows you to determine which tray, or bin, the paper will come from. You should be able to change the paperSource on the fly, which might prove useful should you wish to print company letterhead on a report’s cover page only.
The printerName property stores the name of the printer. If a report’s printer object’s printerName property is blank, the printer specified in _app.printer.printerName is used (all other properties in the report’s printer object are applied). If _app.printer.printerName is blank, the default Windows printer is used. In most cases you should not set this property. Among other things, the printerName property will be saved in the report's source code, which might cause problems should you attempt to render the report on a computer that does not have this printer available.
The printerSource property determines which printerName should be used. For the reason stated above (see printerName), using the choosePrinter( ) method is recommended.
The resolution property allows you to set the resolution for your report's output. This might prove useful if you were using a dot matrix printer to test your report. Since high resolution output on these printers is usually tediously slow, you could drop the resolution to low when testing, and only use high resolution for the final output.
The trueTypeFonts property can be used to determine how the printer will handle TrueType fonts. For the most part it is probably safest to leave this alone.
Call the choosePrinter( ) method to allow the user to choose a printer and set printing options. Each printer object’s choosePrinter( ) method changes the printer settings for that object.
Calling the report object's choosePrinter( ) method
report.printer's choosePrinter( )
allows you to set the printer for the current report. This could be useful in a networked office where several printers are available. Each user could designate a printer where their report should be sent.
Calling the _app object's choosePrinter( ) method
_app.printer.choosePrinter( )
sets the printer for your whole application; the same as the CHOOSEPRINTER( ) function.