SQL/MP Report Writer Guide
Table Of Contents
- What’s New in This Manual
- About This Manual
- 1 Introduction to the NonStop SQL/MP Report Writer
- 2 Using SQLCI and the Report Writer
- 3 Selecting Data for a Report
- 4 Customizing a Report
- Defining the Layout
- Specifying the Items in a Detail Line
- Naming Select List and Detail Line Items
- Organizing Rows Into Break Groups
- Labeling Information
- Formatting Data Values
- Formatting Dates and Times
- Using TACL to Pass Parameters
- Conditional Printing of Items or Line Entries
- Redefining Special Characters
- Calculating Totals
- Calculating Subtotals
- Printing Double-Byte Characters
- A Comparison of the Report Writer and the Enform Language
- Index
Using SQLCI and the Report Writer
HP NonStop SQL/MP Report Writer Guide—527213-001
2-17
Defining Reports in Command Files
You might want to change a layout or style option. For example, you can increase
the number of spaces between columns to 5 as follows:
S> SET LAYOUT SPACE 5;
S> LIST FIRST 1;
ORDERNUM PARTNUM UNIT_PRICE
-------- ------- ----------
Continue adding and revising formatting commands and listing lines until you are
satisfied with your report definition.
To return to the standard SQLCI prompt, enter either LIST ALL or CANCEL.
Remember that LIST ALL and CANCEL delete all formatting commands.
4. Use the following SAVE commands to save in a file the final version of the
SELECT command, each report formatting command, and each option. In this
example, the file is named ORDFILE:
>> SAVE SESSION * TO ORDFILE CLEAR;
>> SAVE LAYOUT * TO ORDFILE;
>> SAVE STYLE * TO ORDFILE;
>> SAVE REPORT * TO ORDFILE;
SAVE SESSION * saves all session options, including LIST_COUNT. CLEAR
clears the previous contents of ORDFILE. SAVE REPORT * saves the SELECT
command and all report formatting commands. The other SAVE commands save
the layout and style options.
You must save the SET LIST_COUNT command before the SELECT command;
otherwise, the report formatting commands will not execute. If you have not set any
other session options that you want to save, you can save only LIST_COUNT by
entering:
SAVE LIST_COUNT TO ORDFILE CLEAR;
You can include more than one report definition in a file by defining sections. A
section begins with the following header line:
?SECTION section-name
Each section can contain a different report definition or portion of a report definition
that you want to execute separately. For example, to execute a section named
SECT1 in the file named REPORTS, enter:
>> OBEY REPORTS (SECT1);
Remember these points when saving a report definition:
•
If you are using the default settings for the layout and style options, you do not
have to save these options. You can either include a RESET LAYOUT * and
RESET STYLE * command in the command file, or you can enter these
commands before you execute the command file. If you know the default
settings are in effect, you can simply execute the command file.