User Tools

Site Tools


printer_control_properties.htm
Navigation:  Language Reference > 7 - Reports > Report Structures >====== Printer Control Properties ====== Previous pageReturn to chapter overviewNext page

These properties control report and printer behavior. All of these properties can be used with either the PRINTER built-in variable or the label of the report as the target, however they may not all make sense with both. These properties are contained in the PRNPROP.CLW file, which you must explicitly INCLUDE in your code in order to use them.

PROPPRINT:DevMode

The entire device mode (devmode) structure as defined in the Windows Software Development Kit. This provides direct API access to all printer properties. Consult a Windows API manual before using this.

The devmode structure is different in 32-bit (consult a Windows API manual). However, the following properties are the most common and useful:

DM_ORIENTATION DM_PAPERSIZE DM_PAPERLENGTH
DM_PAPERWIDTH DM_SCALE DM_COPIES
DM_DEFAULTSOURCE DM_PRINTQUALITY DM_POSITION
DM_DISPLAYORIENTATION DM_DISPLAYFIXEDOUTPUT DM_COLOR
DM_DUPLEX DM_YRESOLUTION DM_TTOPTION
DM_COLLATE DM_FORMNAME DM_LOGPIXELS
DM_BITSPERPEL DM_PELSWIDTH DM_PELSHEIGHT
DM_DISPLAYFLAGS DM_NUP DM_DISPLAYFREQUENCY
DM_ICMMETHOD DM_ICMINTENT DM_MEDIATYPE
DM_DITHERTYPE DM_PANNINGWIDTH DM_PANNINGHEIGHT

PROPPRINT:Collate

Specify the printer should collate the output: 0=off, 1=on (not supported by all printers).

PROPPRINT:Color

Color or monochrome print flag:1=mono, 2=color (not supported by all printers).

PROPPRINT:Context

Returns the handle to the printer's device context after the first PRINT statement for the report, or an information context before the first PRINT statement. This may not be set for the built-in Global PRINTER variable and is normally only read (not set).

PROPPRINT:Copies

The number of copies to print (not supported by all printers).

PROPPRINT:Device

The name of the Printer as it appears in the Windows Printer Dialog. If multiple printer names start with the same characters, the first encountered is used (not case sensitive). May be set for the PRINTER built-in variable only before the report is open.

PROPPRINT:Driver

The printer driver's filename (without the .DLL extension).

PROPPRINT:Duplex

The duplex printing mode (not supported by all printers). Equates(DUPLEX::xxx) for the standard choices are listed in the PRNPROP.CLW file.

PROPPRINT:Extend

PROPPRINT:Extend can be set to TRUE or FALSE at runtime, and references the REPORT target. This determines whether or not the runtime library generates extra information inside the WMF files, which is being used to generate the new report output formats (XML, HTML, PDF etc.).

Set this property to FALSE (0) if you do not want alternate output formats and prefer smaller, compact WMF files (this is default behavior).

PROP:Extend is the runtime property that can be used to set the information for the EXTEND attribute.

PROPPRINT:FontMode

The TrueType font mode. Equates (FONTMODE:xxx) for the modes are listed in the PRNPROP.CLW file.

PROPPRINT:FromMin

When set for the built-in PRINTER variable, this forces the value into the “From:” page number in the PRINTERDIALOG. Specify -1 to disable ranges

PROPPRINT:FromPage

The page number on which to start printing. Specify -1 to print from the start.

PROPPRINT:Paper

Standard paper size. Equates (PAPER:xxx) for the standard sizes are listed in the PRNPROP.CLW file. This defines the dimensions of the .WMF files that are created by the Clarion runtime library's “print engine.”

PROPPRINT:PaperBin

The paper source. Equates (PAPERBIN:xxx) for the standard locations are listed in the PRNPROP.CLW file.

PROPPRINT:PaperHeight

The paper height in tenths of millimeters (mm/10). There are 25.4 mm per inch. Used when setting PROPPRINT:Paper to PAPER:Custom (not normally used for laser printers).

PROPPRINT:PaperWidth

The paper width in tenths of millimeters (mm/10).There are 25.4 mm per inch. Used when setting PROPPRINT:Paper to PAPER:Custom (not normally used for laser printers).

PROPPRINT:Percent

The scaling factor used to enlarge or reduce the printed output, in percent (not supported by all printers). This defaults to 100 percent. Set this value to print at the desired percentage (if your printer and driver support scaling). For example, set to 200 to print at double size, or 50 to print at half size.

PROPPRINT:Port

Output port name (LPT1, COM1, etc.).

PROPPRINT:PrintToFile

The Print to File flag: 0=off, 1=on.

PROPPRINT:PrintToName

The output filename when printing to a file.

PROPPRINT:Resolution

The print resolution in Dots Per Inch (DPI). Equates (RESOLUTION:xxx)for the standard resolutions are listed in the PRNPROP.CLW file. Must be issued before the report is open.

PROPPRINT: SupportCopies

A READ-ONLY property that returns TRUE if the current printer supports output of multiple copies.

PROPPRINT:SupportCollate

A READ-ONLY property that returns TRUE if the current printer supports collating of copies.

Click here for an example that demonstrates the usage of PROP:SupportCopies and PROPPRINT:SupportCollate.

PROPPRINT:ToMax

When set for the built-in PRINTER variable, this forces the value into the “To:” page number in the PRINTERDIALOG. Specify -1 to disable ranges

PROPPRINT:ToPage

The page number on which to end printing. Specify -1 to print to end.

PROPPRINT:Yresolution

Vertical print resolution in Dots Per Inch (DPI). Equates (RESOLUTION:xxx)for the standard resolutions are listed in the PRNPROP.CLW file.

Example:

SomeReport  REPORT

           END

CODE

PRINTER{PROPPRINT:Device} = 'Epson'            !Pick 1st Epson in the list

PRINTER{PROPPRINT:Port} = 'LPT2:'              !Send report to LPT2

 

PRINTER{PROPPRINT:Percent} = 250               !page printed 2.5 times normal

PRINTER{PROPPRINT:Copies} = 3                  !print 3 copies of each page

PRINTER{PROPPRINT:Collate} = False             !print 1,1,1,2,2,2,3,3,3,…

PRINTER{PROPPRINT:Collate} = True              !print 1,2,3…, 1,2,3…,

PRINTER{PROPPRINT:PrintToFile} = True          !print to a file

PRINTER{PROPPRINT:PrintToName} = 'OUTPUT.RPT'  !filename to print to

OPEN(SomeReport)                               !Open report after setting PRINTER properties

SomeReport{PROPPRINT:Paper} = PAPER:User       !Custom paper size

SomeReport{PROPPRINT:PAPERHeight} = 6 * 254    !6“ form height

SomeReport{PROPPRINT:PAPERWidth} = 3.5 * 254   !3.5” form width

printer_control_properties.htm.txt · Last modified: 2021/04/15 15:57 by 127.0.0.1