HP 3000 Manuals

Task 1 - Creating the Report Header [ HP ALLBASE/4GL Developer Self-Paced Training Guide ] MPE/iX 5.0 Documentation


HP ALLBASE/4GL Developer Self-Paced Training Guide

Task 1 - Creating the Report Header 

The first item you must define for every report is the report header.

Menu Path 

From the main menu:

   1.  Select the Reports option

   2.  Choose Header 

Screen Description 

This screen allows you to define the basic operational specifications of
the report.  These specifications include the name of the report, the
primary file for the report, the type of stationery for the report, the
printer to be used, and a brief description of the report.

	       Click here to view figure.
          Report Header Screen 

To enter the field values: 

        Field                 Entry                         Explanation 

---------------------------------------------------------------------------------------

Report Name           product_rept          The name of the report you are creating.

Secured               Accept the default.   This specifies whether this report is
                                            secured against an unauthorized developer
                                            changing the definition.

Report File           Accept the default of This is the name of the MPE/iX formal file
Designator            prod.                 designator for the report output file.  You
                                            can use an MPE/iX file equation to direct
                                            the report to a specific device, or to a
                                            disk file.  By default, the report is
                                            directed to the device class LP.

Primary File[.Record] product               The name of the data file that is the
                                            primary file for this report.  In this
                                            particular report, all the records in this
                                            file are printed.

Index                 Accept the default of The index used to read the file.  Since
                      1.                    this report is not sorted, it also
                                            determines the order in which the records
                                            are printed.  In this report, the file is
                                            printed in product number order.

Printer               D                     Specifies whether the report is printed to
                                            a formal file designator (F), a local
                                            printer attached to your terminal (L),
                                            displayed on your terminal screen (D), or
                                            printed at printer 1, 2, 3 or 4.  These
                                            four printers are defined by your HP
                                            ALLBASE/4GL administrator.

Type of Stationery    Leave this field      Specifies the stationery type that should
                      blank.                be loaded on the printer for this report.
                                            If the specified stationery is not loaded
                                            on the printer, MPE/iX requests the system
                                            operator to change the paper to the correct
                                            type.

          Table 6-0.  (cont.) 

        Field                 Entry                         Explanation 

---------------------------------------------------------------------------------------

Number of Copies      Accept the default of You can print multiple copies of the same
                      1.                    report by specifying a value greater than 1
                                            in this field.

Characters per Line   Accept the default    Specifies the maximum allowable report line
(maximum)             value 80              width.  The width you specify also
                                            determines the maximum width that the
                                            report painter allows you to use when you
                                            create an image of this report.

Actual Page Size in   Accept the default of Specifies the physical form length of the
Lines                 22.                   paper for the report.

Print Lines Used per  Accept the default of The logical page size.  That is, the
Page                  22.                   maximum number of lines that can be printed
                                            on each physical page.

Formfeed Skip to Next Accept the default of Specifies the type of form feeding control
Page                  N.                    that is used.  If you use non-standard size
                                            stationery, you may need to use linefeeds
                                            to advance to the next page.  Entering  Y
                                            specifies a formfeed, and N specifies
                                            multiple linefeeds.

Start of Report       If you are developing This is the name of a function that is
Function Name         the HP ALLBASE/SQL    executed before HP ALLBASE/4GL starts
                      based application,    producing the report.  This function can
                      enter sel_product.    display a screen to obtain user input for
                      Otherwise, leave this parameters that are used within the report,
                      field blank.          or data that is used in the report.

                                            To produce a report for an HP ALLBASE/SQL
                                            database, you must declare and open a
                                            cursor using the SELECT command in an SQL
                                            logic block.  The start of report function
                                            sel_product will contain an SQL command to
                                            call an appropriate SQL logic block.  You
                                            will create this after creating the report
                                            header.

          Table 6-0.  (cont.) 

        Field                 Entry                         Explanation 

---------------------------------------------------------------------------------------

End of Report         Leave blank.          The name of a function to be executed after
Function Name                               the report is produced.  You could use this
                                            function to update data files as a result
                                            of totals obtained during the generation of
                                            the report.

Description           Enter a suitable
                      description.

To complete and commit the screen: 

   1.  When all the entries on this screen are correct, press the  Commit 
       Data  function key to create the report header.  The report header
       is now complete and you can go on to define the remainder of the
       report.

The Next Step for KSAM and TurboIMAGE/iX Applications 

For the KSAM based and HP TurboIMAGE/iX based application, the next step
is to define the print lines used for this report.

   1.  Press the  Previous Menu  function key to return to the reports
       menu.  Then turn to "Task 2 - Creating the Report Line Header."

The Next Step for SQL Based Applications 

If you are developing the HP ALLBASE/SQL based application, you must
first create the sel_product function and the SQL logic block that it
calls.  Follow the procedure below.

Start of Report Function 

Function sel_product 

   1.  Create and generate the sel_product function.

       The sel_product function reads as follows:

       1 SQL select_product
       2 EXIT 

       This function simply calls the SQL logic block select_product.
       Note that this function does not contain a FILE *NEXT command.
       The report generator performs the equivalent operation to a FILE
       *NEXT command when it accesses the primary file for the report.
       In this case, the primary file for the report is the active set
       for the cursor defined by the SQL block select_product.

   2.  Create and generate the SQL Logic Block select_product.

       The select_product SQL logic block contains the following command:

       SELECT :product FROM sqlgrp.product
         ORDER BY product_no;

       This SELECT command contains an ORDER BY clause.  This clause
       ensures that records are retrieved in the required order for the
       report.



MPE/iX 5.0 Documentation