NEW-REPORT

Function

Closes the current report output file and opens a new one with the specified filename.

Syntax

NEW-REPORT {report_filename_txt_lit|_var|_col}

Arguments

report_filename_txt_lit|_var|_col

A new file name.

Description

NEW-REPORT is normally used with single reports. When used with multiple report declarations, NEW-REPORT affects the current report only.

The internal page counter is reset to 1 when NEW-REPORT is executed.

Note:

Production Reporting does not actually create a report output file until the first page is completed. It is possible that NEW-REPORT will not create a new file, for example, if no data is selected and nothing is printed on the page.

Examples

The following example shows the NEW-REPORT command:

new-report  'rep2a.lis'
new-report  $next-file

You can assign the report filename within an Production Reporting report by issuing NEW‑REPORT before printing. You might even prompt for the filename to use, as shown here:

begin-report
  input  $file  'Enter report filename'
  new-report  $file
  ...

After NEW-REPORT executes, the reserved variable $sqr-report updates to reflect the new report name.

See Also