Equinox Online Help - Language Reference - A to Z

Home

ChoosePrinter

Applies to
SyntaxChoosePrinter [how, name, orientation, size, source, copies, file]
Action[Statement] Launches the Windows Print dialog.
ScopeOnly usable in report methods.
Notes

A parameter which is missed out or supplied as -1 is ignored and the value from the report file is used instead. The command PrinterSettings returns the current values.

How:

  • 0 (or missing) = show dialog and allow printer changes only.
  • 1 = show dialog and allow change of all settings.
  • 2 = don't show dialog. MUST use the following parameters:

Name:

  • missing = no change
  • " = Windows default
  • other = a named printer.

Orientation:

  • -1 (or missing) = no change
  • 0 = use value from printer
  • 1 = Portrait
  • 2 = Landscape

Size:

  • -1 or missing = no change
  • 0 = use value from printer
  • 1 - 41 = paper size (Options for paper size).
  • Other values (42 to 255) may select printer-dependent sizes.

Source:

  • -1 (or missing) = no change
  • 0 = use value from printer
  • 1 - 15 = paper bin (Options for paper source).
  • Other values (16 to 255) may select printer-dependent types.

Copies:

  • -1 (or missing) = no change
  • 0 = use value from printer
  • 1 - n - specify number or copies.

File:

  • -1 (or missing) = no change
  • 0 = use value from printer
  • 1 = to printer
  • 2 = to file.

After the command has executed, SysError is zero unless an error has occurred:

SysReply contains one of the following values:

  • -1 An operational error occurred
  • -2 No response from the user (controlled by SysTimeout)
  • -1 Escape pressed
  • 0 No dialog displayed
  • 1 Ok pressed

When Equinox executes the report, it tries to attach to the printer requested. If the printer is not available for any reason, Equinox displays the following dialog:

The operator can choose another printer or cancel the report.

The 'choose printer' dialog that appears in the former case is the same as the one that appears at design time (see Print Setup) with the addition of a check box entitled "remember this printer in future". If the operator checks this box (and if Equinox successfully connects to the printer), the name of the report and the printer details are saved in the workstation .INI file.

Client-server Equinox uses a section identified by the application, the workstation computer name and "Reports". The report name is the key that contains the printer details. If for some reason the operator chooses to remember a valid but incorrect printer, the offending line will have to be removed from the .INI.

If the printer configuration is changed and Equinox is no longer able to connect to it, the line is removed automatically from the .ini file and the operator is prompted again. Single-user Equinox operates in a similar way, using a section containing the application name and "EquinoxReports".

CategoryReports
See Also ForceBreak, NewPage, Print Setup, PrinterSettings, ReportField, ResetBlock
Example

The following example could be attached to the At start of task event of a report, to display the Windows Print dialog when the report is run.

ChoosePrinter

To give users the ability to change any of the settings on the dialog, you could use this example:

ChoosePrinter 1

To remove the users ability to even see the print dialog window you could use the following code. (if you remove a users choice of printer and settings, you must provide the defaults).

ChoosePrinter 2,",0,0,0,0,0