Using the DECLARE-TOC Command

Use DECLARE-TOC to define a table of contents and its attributes. When generating multiple reports and tables of contents from one SQR program, you can also use the TOC argument of the DECLARE-REPORT command.

You must issue the DECLARE-TOC command in the SETUP section of the program. For example:

begin-setup
      declare-toc toc_name
          for-reports = (all)
          dot-leader = yes
          indentation = 2
      end-declare
     .
     .
     .
end-setup

Following the DECLARE-TOC command, specify a table of contents name. Use the FOR-REPORTS argument to specify the reports within the SQR program that use this table of contents. Use (all) if you want all of the reports to use one table of contents. You need to specify individual report names only if you are generating multiple reports with different tables of contents from one program. Use DOT-LEADER to specify whether a dot leader precedes the page number. The default setting is NO, and the dot leader is suppressed in all HTML output except when you also specify -BURST:T with -PRINTER:HT. Use INDENTATION to specify the number of spaces by which each level is indented. (The default setting is 4.)

DECLARE-TOC also supports procedures that are frequently used for setup and initialization purposes, as described in this table:

Procedure

Usage

BEFORE-TOC

Specifies a procedure to be run before the table of contents is generated. If no table of contents is generated, the procedure does not run.

AFTER-TOC

Specifies a procedure to be run after the table of contents is generated. If no table of contents is generated, the procedure does not run.

BEFORE-PAGE

Specifies a procedure to be run at the start of each page.

AFTER-PAGE

Specifies a procedure to be run at the end of each page.