DECLARE-TOC

Function

Defines the Table of Contents and its attributes.

Syntax

DECLARE-TOC toc_name
[FOR-REPORTS=(report_name1[,report_namei]...)]
[DOT-LEADER=YES|NO]
[INDENTATION=position_count_num_lit]
[BEFORE-TOC=procedure_name[(arg1[,argi]...)]]
[AFTER-TOC=procedure_name[(arg1[,argi]...)]]
[BEFORE-PAGE=procedure_name[(arg1[,argi]...)]]
[AFTER-PAGE=procedure_name[(arg1[,argi]...)]]
[ENTRY=procedure-name [(argi [,argi] ...)]]
END-DECLARE

Arguments

toc_name

Name of the Table of Contents.

FOR-REPORTS

One or more reports that use this Table of Contents.

DOT-LEADER

Whether a dot leader precedes the page number. The default is NO.

INDENTATION

Number of spaces to indent each level. The default is 4.

BEFORE-TOC

Procedure executed before generating the Table of Contents. If no Table of Contents is generated, the procedure does not execute.

AFTER-TOC

Procedure executed after generating the Table of Contents. If no Table of Contents is generated, the procedure does not execute.

BEFORE-PAGE

Procedure executed at the start of every page.

AFTER-PAGE

Procedure executed at the end of each page.

ENTRY

Procedure that is executed to process each Table of Contents entry (instead of Production Reporting doing it for you). When this procedure is invoked, the following Production Reporting-reserved variables are populated with data about the TOC entry:

   #SQR-TOC-LEVEL

Contains the level

   $SQR-TOC-TEXT

Contains the text

   #SQR-TOC-PAGE

Contains the page number

These are global variables. If the procedure is local, you must precede it with an underscore (for example, #_sqr-toc-page). These three Production Reporting-reserved variables are only valid within the scope of the ENTRY procedure. They can be referenced outside the scope, but their contents are undefined.

Description

Use DECLARE-TOC in the SETUP section.

You can use DECLARE-TOC to declare one or more Table of Contents for the application.

A Table of Contents can be shared between reports.

Example

begin-setup
  declare-toc common
    for-reports=(all)
    dot-leader=yes
    indentation=2
  end-declare
end-setup
.
.
.
toc-entry level=1 text=$Chapter
toc-entry level=2 text=$Heading
.
.

See Also

BEGIN-FOOTING, BEGIN-HEADING, DECLARE-REPORT, and TOC-ENTRY