4D v14.3

PRINT RECORD

Home

 
4D v14.3
PRINT RECORD

PRINT RECORD 


 

PRINT RECORD ( {aTable}{;}{* | >} ) 
Parameter Type   Description
aTable  Table in Table for which to print the current record or Default table if omitted
* | >  Operator in * to suppress the printer dialog boxes, or > to not reinitialize print settings

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.

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.

 FORM SET OUTPUT([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)
 FORM SET OUTPUT([Invoices];"Standard Output") ` Restore the previous output form

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)
    FORM SET OUTPUT([Employees];"Detailed") `Use the first print form
    PRINT RECORD([Employees];>) `Print using user-defined parameters
    FORM SET OUTPUT([Employees];"Simple") `Use the second print form
    PRINT RECORD([Employees];>) `Print using user-defined parameters
    FORM SET OUTPUT([Employees];"Output") `Restore default output form
 End if

 
PROPERTIES 

Product: 4D
Theme: Printing
Number: 71

Different in remote mode

 
HISTORY 

Modified: 4D 2004

 
SEE ALSO 

Print form

 
ARTICLE USAGE

4D Language Reference ( 4D v12.4)
4D Language Reference ( 4D v14 R3)
4D Language Reference ( 4D v14 R2)
4D Language Reference ( 4D v13.5)
4D Language Reference ( 4D v14.3)
4D Language Reference ( 4D v14 R4)

Inherited from : PRINT RECORD ( 4D v11 SQL Release 6)