DECLARE PROCEDURE

Note:

This command may be discontinued in a future release. We highly recommend that you no longer use this command. To take advantage of newer Production Reporting functionality, use DECLARE‑PROCEDURE.

Function

Defines specific event procedures.

Syntax

DECLARE PROCEDURE
[BEFORE-REPORT=procedure_name]
[AFTER-REPORT=procedure_name]
[BEFORE-PAGE=procedure_name]
[AFTER-PAGE=procedure_name]

Arguments

BEFORE-REPORT				 

A procedure to execute at the time of the first PRINT command. It may be used, for example, to create a report heading.

AFTER-REPORT				 

A procedure to execute just before the report file is closed at the end of the report. It can be used to print totals or other closing summary information. If no report was generated, the procedure does not execute.

BEFORE-PAGE 				

A procedure to execute at the beginning of every page, just before the first PRINT command for the page. It can be used, for example, to set up page totals.

AFTER-PAGE 				

A procedure to execute just before each page is written to the file. It can be used, for example, to display page totals.

Description

DECLARE PROCEDURE can be issued either in the SETUP section or in the body of the report. You can use the command as often as you like.

If you issue multiple DECLARE PROCEDURE commands, the last one takes precedence. In this way, you can turn procedures on and off while the report is executing. The referenced procedures do not take any arguments; however, the variables can be local by using the LOCAL argument. In addition, they can only PRINT into the body of the report, that is, they cannot PRINT into the header and/or footer areas.

Examples

declare procedure
   before-page=page_setup
   after-page=page_totals