4D v14.3

QR REPORT

Home

 
4D v14.3
QR REPORT

QR REPORT 


 

QR REPORT ( {aTable ;} document {; hierarchical {; wizard {; search {; methodName {; *}}}} ) 
Parameter Type   Description
aTable  Table in Table to use for the report, or Default table if omitted
document  String in Quick Report document to load
hierarchical  Boolean in True = Display related Many tables, False or omitted = Do not display (default)
wizard  Boolean in True = Display the wizard button, False or omitted = Do not display (default)
search  Boolean in True = Display the search tools and master table choice, False or omitted = Do not display (default)
methodName  String in Name of method to call
Operator in Deletion of printing dialog boxes

QR REPORT prints a report for aTable, created with the Quick Report editor shown here.

The Quick Report editor allows users to create their own reports. See the 4D Design Reference manual for details on creating reports with the Quick Report editor.

Notes:

  • The editor does not appear if the table has been declared “Invisible.” 
  • When the editor is called using the QR REPORT command, the All relations in automatic option that is used to modify the automatic/manual status of the relations is hidden. This allows the developer to manage this status himself using the SET AUTOMATIC RELATIONS and SET FIELD RELATION command.
  • The editor is called in an external window and it is not possible to use the QR ON COMMAND command in this context. However, you can use the methodName parameter to execute custom code when an interface command is activated (see below).

The document parameter is a report document that was created with the Quick Report editor and saved on disk. The document stores the specifications of the report, not the records to be printed.
If an empty string ("") is specified for document, QR REPORT displays an Open File dialog box and the user can select the report to print.
If the document parameter specifies a document that does not exist (for example, pass Char(1) in document), the Quick Report editor is displayed.

The hierarchical parameter defines whether the related Many tables are displayed in the field selection list. By default, this value is set to 0 (no display for related Many tables).

The wizard parameter indicates whether the Open Wizard button is going to be displayed in the Quick Report editor, therefore either allowing or disallowing access to the wizard. By default, this value is set to False (no access to the wizard).

The search parameter indicates whether the New Query button and the Master table drop-down menu are going to be displayed in the Quick Report editor, therefore either allowing or disallowing modification of the current table and current master table. By default, this value is set to False (no access to the search tools and master table).

The methodName parameter designates a 4D project method that will be executed each time a command of the Quick Report editor is called by selecting a menu item or clicking on a button. Using this parameter is equivalent to using QR ON COMMAND in the context of the Quick Report editor window (QR ON COMMAND only works within the context of an included area). More particularly, you can use this new parameter to change the character set used by the quick report.
The methodName method receives two parameters:

  • $1 contains the area reference (longint).
  • $2 contains the number of the command selected (longint). You can compare this value with the constants of the QR Commands theme.

Note: If you want to compile your database using the Compiler, you must declare the $1 et $2 parameters explicitly as longints, even if you do not use them.

If you want to execute the initial command chosen by the user, use the following statement in the methodName method:


If the methodName parameter is an empty string ("") or is omitted, no method is called and the standard operation of QR REPORT is applied.

After a report is selected, the dialog boxes for printing are displayed, unless the * parameter is specified. If this parameter is specified, these dialog boxes are not displayed. The report is then printed.

If the Quick Report editor is not involved, the OK variable is set to 1 if a report is printed; otherwise, it is set to 0 (zero) (i.e., if the user clicked Cancel in the printing dialog boxes).

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.
  • The syntax which makes the Quick Report editor appear does not work with 4D Server; in this case, the system variable OK is set to 0.
  • In the case of a problem concerning the printer (out of paper, printer disconnected, etc.), no error message is generated.

The following example lets the user query the [People] table, and then automatically prints the report “Detailed Listing”:

 QUERY([People])
 If(OK=1)
    QR REPORT([People];"Detailed Listing";False;False;False;*)
 End if

The following example lets the user query the [People] table, and then lets the user choose which report to print:

 QUERY([People])
 If(OK=1)
    QR REPORT([People];"";False;False;False)
 End if

The following example lets the user query the [People] table, and then displays the Quick Report editor so the user can design, save, load and print any reports with or without the wizard:

 QUERY([People])
 If(OK=1)
    QR REPORT([People];Char(1);False;True)
 End if

Refer to the example of the SET FIELD RELATION command.

You want to convert the character set used in a quick report called using QR REPORT into Mac Roman:

 QR REPORT([MyTable];Char(1);False;False;False;"myCallbackMeth")

The myCallbackMeth method converts the report when it is generated:

 C_LONGINT($1;$2)
 If($2=qr cmd generate//if we generated a report
    C_BLOB($myblob)
    C_TEXT($path;$text)
    QR EXECUTE COMMAND($1;$2//execution of command
    QR GET DESTINATION($1;$type;$path//retrieval of destination
    DOCUMENT TO BLOB($path;$myblob)
  //conversion to text using UTF-8
    $text:=Convert to text($myblob;"UTF-8")
  //use of MacRoman set
    CONVERT FROM TEXT($text;"MacRoman";$myblob)
  //Return of converted report
    BLOB TO DOCUMENT($path;$myblob)
 Else //otherwise, execution of the command
    QR EXECUTE COMMAND($1;$2)
 End if

 
PROPERTIES 

Product: 4D
Theme: Quick Report
Number: 197

The OK variable is changed by the commandDifferent in remote mode

 
HISTORY 

New
Modified: 4D 2004
Modified: 4D v14

 
SEE ALSO 

PRINT LABEL
PRINT SELECTION
SET ALLOWED METHODS

 
ARTICLE USAGE

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

Inherited from : QR REPORT ( 4D v12.4)