17. System Commands for the Forms-based Tools : report Command--Run a Report
Share this page                  
report Command--Run a Report
The report command produces a report for a table in the database. The command creates either a default report or runs a report set up by the rbf or sreport command.
The report command has the following format:
report dbname |vnode::dbname[/server_class] [-r|-m [style]] report_target
(variable=value {,variable=value})] [-foutputfile] [-oprinter] [-ncopies] [-5]
[-6] [+b|-b] [-d] [-h] [-lpagewidth] [-qmxquer] [+t|-t] [-vpagelength] [-wmxwrap]
[-ifilename] [-s] [-uusername] [-Ggroupid] [-numeric_overflow=fail|ignore|warn]
Indicates that a report (rather than a table, view, or synonym) is specified as the report_target. If the specified report is not found, an error message is returned.
Indicates that a table is specified as the report_target. This instructs report to format a default report for the specified table.
The optional style specifies the style of your report. Accepted values are wrap, tabular (same as column), block, labels, and indented. If you do not specify a style, report selects either tabular or block, depending on the width of your report. Tabular is used if all of the columns fit on one page; otherwise, block is selected. The default report width is 132 characters.
Specifies the name of the object on which you wish to run the report. The report_target can be:
An existing report, created using RBF or sreport.
A table, view, or synonym in your database on which you want a default report formatted.
The table, view, or synonym name can be qualified with a valid schema name in the format schema.name, as described in Schema Qualifier.
You can specify the type of report_target by using the –r or –m flag. If neither flag is specified, the report command looks first for a report having the specified name. If a report is not found, but a table with the same name exists, report sets up a default report for that table.
Specifies the name of a parameter (variable) used in the report, and the value that is replaced for every occurrence of the corresponding variable name in the report specifications. If you want to specify a string or a date, value must be quoted. You can separate variable and value combinations using blanks, tabs, or commas.
If the (variable=value) parameter includes characters that are treated specially by your operating system (such as parentheses in Windows and UNIX or slashes in VMS), the entire parameter must be enclosed in double quotes to pass it through the operating system. For details, see the Passing Parameters on the Command Line section.
Directs the formatted report to the outputfile. If this option is not specified, the report is written to the standard output file (normally your terminal), or, in the case of a report specified by the Report Writer, to the file designated by the .output command in the report specification file.
Turns off the default formatting for UTF8 installations, which allows reports containing multibyte UTF-8 characters to be formatting for display on a UTF8 enabled terminal. This option is the same as II_PRINT_UT8ALIGN=OFF.
Sends the report to the specified printer.
To set a default printer, define ING_PRINT. If you require special print options, specify the options in ING_PRINT, and specify the –o flag with no argument.
Specifies the number of copies of the report to print.
Forces version 5 compatibility mode, as follows:
The +t option is the default for aggregates.
All arithmetic is floating-point, unless all values in the computation are integers.
By default, the month portion of the current_date() function is displayed in uppercase letters.
(SQL reports only) Eliminates duplicate rows from reports whose specification contains .data, .table, .view, or .sort statements.
Forces (+b) or suppresses (-b) form feed at the end of each page. The flag overrides formfeed or .noformfeed commands in the report specification file.
Directs report to continue running the specified report if the .setup or .cleanup statements generate DBMS errors.
Provides a null set of data for a report that retrieves no rows. All .header and .footer sections are executed. The detail section is suppressed. This feature allows you to include the following .if statement in the report footer to indicate that no rows were found:
if count(column) = 0 .then
“No data matched the
query specifications.”
Sets the maximum output line size to pagewidth characters. By default, if output is to a file, the maximum output line size is 132 characters; otherwise, the default maximum line size is the width of the terminal.
Sets the maximum length of the query after all substitutions for runtime parameters have been made to mxquery characters. By default, the maximum query size is 2048 characters. This option is needed for long queries only.
Causes aggregates and breaks to use underlying values (-t) or rounded values (+t) for any floating-point column whose format has been specified in a .format command as numeric F or template. If +t is specified, each value in the column is rounded to the precision given by its format, and breaks for date columns that use a date template occur over the actual value appearing for the dates.
Default: –t
Sets the number of lines for each page of output. The pagelength must be a positive integer. This flag overrides any .pagelength command in the report specification file.
Default: 61 lines per page if the report is written to a file; 23 lines per page if written to a terminal.
Specifies the maximum number of lines to wrap (mxwrap) with one of the column C formats, or the maximum number of lines that can be used in any block.
Default: 300. This maximum is provided as a protection against misspecified columns and is rarely needed.
Reads a report specification from the specified file outside of the database, and runs the report. Using this flag eliminates the need to use the sreport command to place the report source file in the database for processing.
When using this flag, you must omit report_target and the –r|-m flag.
Suppresses status messages.
-numeric_overflow=fail | ignore | warn
Sets error-handling mode for numeric overflow.
(Default) Causes an error message to be issued and the statement is aborted. To obtain ANSI-compliant behavior, use this setting (or omit for the default).
Causes no error message to be issued.
Causes a warning message to be issued.