Using the Report Processor in Conductor

The Report Processor in Conductor, RPTSHELL, asks the user where to send the output from a report, handles printer selection and setup, calls a query process or uses a collector window to get user input in order to select records, then calls the report requested. This program may be used as a shell around any R/List report, R/Basic program/report, Merge report, or simply to select records for a process. This program is called for all built-in reports in Conductor and can be run from the command line or added to custom menus as demonstrated below.

Command line syntax:

RPTSHELL SELECT_TYPE RPT_TYPE RPT_NAME

Where: 

SELECT_TYPE

For query processing using a data entry window, pass in

"Q~template_name".

To call one or more collector windows, use the following syntax for one collector:

"C~filename~window~fieldname"

and for multiple collectors:

"C~file~window1/window2~field1/field2"

with each window and fieldname separated by a forward slash.

An optional fifth parameter to the "C" type argument is used to indicate that the collector will set the first two fields in @PSEUDO and a range selection (instead of exact match) should be done. To include this parameter, add a third tilde (~) and then use the numeral one (1) for each window that is to do range selections, and the numeral zero (0) for each window that is an exact match separating the zeros and ones with forward slashes (just as the window and field names are done). To skip any record selection, pass in "N" for none; this will allow R/List or custom programs commands to access the entire file

RPT_TYPE

"RLIST", "RBASIC", "MERGE", "NORPT" or "BRW". The NORPT type is included to allow use of this program for record selection without custom programming from any process where it may be required.

RPT_NAME

For RLIST types, the name of the report to execute from the REPORTS or QUERIES file. If the report is located in a file other than REPORTS or QUERIES, pass the filename in before the report name and use a tilde (~) to separate, eg. FILENAME~RPT_NAME.

For RBASIC types, the command line to execute, with any arguments separated by tildes (~), eg. PGM~ARG1~ARG2.

For MERGE or BRW types, the name of the report to be executed.

For NORPT, this parameter may be left blank and is not used.

 

Using Query windows to select records

EXAMPLES using the Query mode to select records:

RPTSHELL Q~EMPLOYEES RLIST RPT_EMP_RPT

This command calls the EMPLOYEES window in query mode to select records, then runs the RPT_EMP_RPT R/List report.

RPTSHELL Q~EMPLOYEES RBASIC RPT_W2~1

This command calls the EMPLOYEES window in query mode to select records, then runs the PRT_W2 R/Basic program with an argument of 1.

RPTSHELL Q~EMPLOYEES MERGE EMP_MRG

This command calls the EMPLOYEES window in query mode to select records, then executes the EMP_MRG merge.

RPTSHELL Q~EMPLOYEES NORPT

This command calls the EMPLOYEES window in query mode to select records. This select list is usually then passed to another process.

Related Information: A list of windows for Query mode

 

Using Collector windows to select records

A collector window that may be used with the report processor may have one or two fields, and if there are two fields, they must be of the same type and used with the RANGE flag to select records based upon a range of values. For example, you want to select all invoices from 1/1/97 to 12/31/97. This could be accomplished by using the DATES window, which has two fields, and the following command:

RPTSHELL C~INVOICE_REGISTER~DATES~INV_DATE~1

If you wished to restrict the user to selecting records for only a single invoice date, you would use the DATE window, which has only one field for entry, and the following command:

RPTSHELL C~INVOICE_REGISTER~DATE~INV_DATE

Note: The "~0" indicating that this is not a range of dates, is optional and may be omitted, as it was here.

If you are selecting for a range of values, the exact select statement that is run is dependent on the user's input. If the first value in the collector window is left blank, the resulting command selects records with a value less than or equal to the user input into field two. Conversely, If the second value in the collector window is left blank, the resulting command selects records with a value greater than or equal to the user input into field one. If the user enters a value into both fields, records will be selected with values ranging from the first value to the second value, inclusive.

EXAMPLES

RPTSHELL C~INVOICE_REGISTER~DATES~INV_DATE~1

This command calls the DATES collector window to select records from the INVOICE_REGISTER file, using the DATES window, to select invoices within a range of invoice dates.

RPTSHELL C~INVOICE_REGISTER~DATE~INV_DATE

This command calls the DATE collector window to select records from the INVOICE_REGISTER with a single invoice date, entered by the user.

Related Information: A list of Collector windows  

 

Calling a report without selecting records

The report processor may also be used to call reports that have their own selection criteria built-in or that will always report on an entire file. This is done using the Select_Type of N.

EXAMPLE

RPTSHELL N RLIST RPT_SKILL_CODES

Run the R/List report RPT_SKILL_CODES for all skill codes