PRINT RECORD

4D - Documentation   Français   English   German   Spanish   4D v11 SQL, Command Theme List   4D v11 SQL, Command Alphabetical List   4D v11 SQL, Constant Theme List   Back   Previous   Next

version 2004 (Modified)


PRINT RECORD ({aTable}{; }{* | >})

ParameterTypeDescription
aTableTableTable for which to print the current record or
Default table if omitted
* | >* | >* to suppress the printer dialog boxes, or
> to not reinitialize print settings

Description

PRINT RECORD prints the current record of aTable, without modifying the current selection. The current output form is used for printing. If there is no current record for aTable, PRINT RECORD does nothing.

You can print subforms with the PRINT RECORD command. This is not possible with Print form.

Note: If there are modifications to the record that have not been saved, this command prints the modified field values, not the field values located on disk.

By default, PRINT RECORD displays the printer dialog boxes before printing. If the user cancels either of the printer dialog boxes, the command is canceled and the record is not printed.

You can suppress these dialog boxes by using either the optional asterisk (*) parameter or the optional "greater than" (>) parameter:

The * parameter causes a print job using the current print parameters (default parameters or those defined by the PAGE SETUP and/or SET PRINT OPTION commands).

Furthermore, the > parameter causes a print job without reinitializing the current print parameters. This setting is useful for executing several successive calls to PRINT RECORD (e.g. inside a loop) while maintaining previously set customized print parameters.

4D Server: This command can be executed on 4D Server within the framework of a stored procedure. In this context:

Make sure that no dialog box appears on the server machine (except for a specific requirement). To do this, it is necessary to call the command with the * or > parameter.

In the case of a problem concerning the printer (out of paper, printer disconnected, etc.), no error message is generated.

Warning: Do not use the PAGE BREAK command with PRINT RECORD. PAGE BREAK is exclusively reserved for use in combination with the Print form command.

Examples

1. The following example prints the current record of the [Invoices] table. The code is contained in the object method of a Print button on the input form. When the user clicks the button, the record is printed using an output form designed for this purpose.

   OUTPUT FORM([Invoices];"Print One From Data Entry") ` Select the right output form for printing
   PRINT RECORD([Invoices];*) ` Print Invoices as it is (without showing the printing dialog boxes)
   OUTPUT FORM([Invoices];"Standard Output") ` Restore the previous output form

2. The following example prints the same current record in two different forms. The code is contained in the object method of a Print button on the input form. You want to set customized print parameters and then use them in the two forms.

   PRINT SETTINGS   `User defines print parameters
   If (OK=1)
      OUTPUT FORM([Employees];"Detailed")   `Use the first print form
      PRINT RECORD([Employees];>)    `Print using user-defined parameters
      OUTPUT FORM([Employees];"Simple")   `Use the second print form
      PRINT RECORD([Employees];>)   `Print using user-defined parameters
      OUTPUT FORM([Employees];"Output")   `Restore default output form
   End if 

See Also

Print form.


4D - Documentation   Français   English   German   Spanish   4D v11 SQL, Command Theme List   4D v11 SQL, Command Alphabetical List   4D v11 SQL, Constant Theme List   Back   Previous   Next