DB2 graphic  QMF Version 8

Refining the format of your report with detail blocks

You can reformat and add text to your report with detail blocks. A detail block is a set of specifications that tells QMF to put in whatever special formatting you want for one row of the data retrieved by your query.

Specify detail blocks on the FORM.DETAIL panel. You can use the panel to do the following:

In the following example, you use the FORM.DETAIL panel to reformat the report in Figure 118. You will also remove the column headings from the report, omit tabular data (columns), and add headings for each subsection. When you finish, the report will look like Figure 121.

To specify detail blocks:

  1. On the QMF command line, enter:
    DISPLAY FORM.DETAIL
    The FORM.DETAIL panel displays.
    Figure 119. Specify text for the detail heading on FORM.DETAIL.
     FORM.DETAIL                                          MODIFIED     Var 1  of 1
     
     Include Column Headings with Detail Heading? ===> NO
     LINE  ALIGN   DETAIL HEADING TEXT
     ----  ------  ----+----1----+----2----+----3----+----4----+----5----+
     1     LEFT    *****************************
     2     LEFT    ** PERSONNEL STATUS REPORT **
     3     LEFT    *****************************
     
     New Page for Detail Block? ===> NO      Repeat Detail Heading?    ===> NO
     Keep Block on Page?        ===> NO      Blank Lines after Block   ===> 0
     Put Tabular Data at Line (Enter 1-999 or NONE) ===> 1
     LINE  ALIGN   DETAIL BLOCK TEXT
     ----  ------  ----+----1----+----2----+----3----+----4----+----5----+
     1     LEFT
     2     LEFT
                   *** END ***
     
     Select Panel Variation?    ===> YES
     
  2. Because the final report is not in tabular format (columns and rows), you do not want to display the column headings. Type NO in the Include Column Headings with Detail Heading? field for this example.

    If you leave YES, the column headings display immediately after any detail heading text in the report.

  3. Type the detail heading text for each line in the DETAIL HEADING TEXT field. You can use form variables in the text.

    For this example, type the text as it is shown on the FORM.DETAIL panel in Figure 119. You need to insert an extra line and change its line number.

    Next, rearrange the data from each column into a vertical list, rather than a tabular arrangement of columns and rows. Give each column value a new label to replace the column headings. Specify the format of the detail block on the bottom half of the FORM.DETAIL panel.

  4. Leave the defaults, or type new values for the New Page for Detail Block?, Repeat Detail Heading?, Keep Block on Page?, and Blank Lines After Block fields.

    For this example, type 1 for Blank Lines After Block.

  5. Type a line number if you want to include tabular data in the report, or type NONE if you want to remove all the tabular data.

    For this example, type NONE, to remove all the tabular data from the report.

  6. Type the detail block text for each line in the DETAIL BLOCK TEXT field. Use form variables and text to provide values for the column headings and column data on the report.

    For this example, type the text as it is shown on the following FORM.DETAIL panel.

    Figure 120. Specify replacement column headings with detail block text.
     LINE  ALIGN   DETAIL BLOCK TEXT
     ----  ------  ----+----1----+----2----+----3----+----4----+----5----+
     1     LEFT            Employee:  &2
     2     LEFT                  ID:  &1
     3     LEFT    Years of Service:  &5
     4     LEFT              Salary:  &6
     5     LEFT          Commission:  &7

    You can create variations of the detail blocks to use with different conditions in a report format with panel variations. For more information on creating panel variations, see DB2 QMF Reference.

  7. Press the Report function key to see the changed report.
    Figure 121. The changed report shows the results of reformatting.
     Employee Data for the WESTERN Division
     Date: 1998-03-17
     
     
     *****************************
     ** Personnel Status Report **
     *****************************
     Department number 66, Department name PACIFIC
     Manager: 270
     
     
     Position: CLERK
             Employee:  BURKE
                   ID:  330
     Years of Service:  1
               Salary:  10988.00
           Commission:  55.50
     
     
     ===> Number in CLERK position in Department 66:  1
     
     Position: MGR
             EMPLOYEE:  LEA
                   ID:  270
     Years of Service:  9
               Salary:  18555.50
           Commission:  -
     
     
     ===> Number in MGR position in Department 66:  1


Go to the previous page Go to the next page

Downloads | Library | Support | Support Policy | Terms of use | Feedback
Copyright IBM Corporation 1982,2004 Copyright IBM Corporation 1982, 2004
timestamp Last updated: March, 2004