DB2 graphic  QMF Version 8

Lesson Three: Customizing a report

QMF displayed the data you retrieved in the previous lesson as a report. A report is a display of data that is formatted to make it easy to read or view.

When you run a query, QMF uses a default report format to display the report. You can change the appearance of your report by changing the default report format. In this lesson, you will learn how to change column headings and column widths, and add a page heading to the report you just displayed. You can perform many of these tasks from within a Windows environment by using the DB2 QMF for Windows feature.

To change the appearance of a report:

  1. From the report panel, press the Form function key to display the default report form.

    The FORM.MAIN panel displays:

    Figure 15. The FORM.MAIN panel
     FORM.MAIN
     
     COLUMNS:               Total Width of Report Columns: 50
      NUM COLUMN HEADING                           USAGE   INDENT WIDTH EDIT  SEQ
      --- ---------------------------------------- ------- ------ ----- ----- ---
        1 NAME                                             2      9     C     1
        2 DEPT                                             2      6     L     2
        3 JOB                                              2      5     C     3
        4 SALARY                                           2      10    L2    4
        5 COMM                                             2      10    L2    5
     
     PAGE:    HEADING  ===>
              FOOTING  ===>
     FINAL:   TEXT     ===>
     BREAK1:  NEW PAGE FOR BREAK? ===> NO
              FOOTING  ===>
     BREAK2:  NEW PAGE FOR BREAK? ===> NO
              FOOTING  ===>
     OPTIONS: OUTLINE? ===> YES                DEFAULT BREAK TEXT? ===> YES
     
     1=Help     2=Check    3=End          4=Show          5=Chart         6=Query
     7=Backward 8=Forward  9=            10=Insert       11=Delete       12=Report
     OK, FORM is displayed.
     COMMAND ===>                                                  SCROLL ===> PAGE
    First, change some column names.

    When you use the default report form, QMF assigns a name, usually the column name from the table, to each column on the report.

  2. Move the cursor to the column name NAME and type EMPLOYEE_NAME.

    Be sure to type an underscore between each word in the column heading.

  3. Type DEPT_NUMBER for DEPT.
  4. Type COMMISSIONS for COMM.

    Next, you need to change the column width of the COMMISSIONS column so the title will fit.

  5. Move the cursor to the column width for COMMISSIONS and type 11.

    Finally, you will specify the text you want to display at the top of each page of your report.

  6. Move the cursor to PAGE: HEADING ==> and type:
    TOTAL COMMISSIONS - CLERKS

    You have finished making your changes to the report format. The FORM.MAIN panel should look like this:

    Figure 16. The FORM.MAIN panel shows the changes you want.
     FORM.MAIN                                            MODIFIED
     
     COLUMNS:               Total Width of Report Columns: 51
      NUM COLUMN HEADING                           USAGE   INDENT WIDTH EDIT  SEQ
      --- ---------------------------------------- ------- ------ ----- ----- ---
        1 EMPLOYEE_NAME                                    2      9     C     1
        2 DEPT_NUMBER                                      2      6     L     2
        3 JOB                                              2      5     C     3
        4 SALARY                                           2      10    L2    4
        5 COMMISSIONS                                      2      11    L2    5
     
     PAGE:    HEADING  ===> TOTAL COMMISSIONS - CLERKS
              FOOTING  ===>
     FINAL:   TEXT     ===>
     BREAK1:  NEW PAGE FOR BREAK? ===> NO
              FOOTING  ===>
     BREAK2:  NEW PAGE FOR BREAK? ===> NO
              FOOTING  ===>
     OPTIONS: OUTLINE? ===> YES                DEFAULT BREAK TEXT? ===> YES
     
     1=Help     2=Check    3=End          4=Show          5=Chart         6=Query
     7=Backward 8=Forward  9=            10=Insert       11=Delete       12=Report
     OK, cursor positioned.
     COMMAND ===>                                                  SCROLL ===> PAGE
  7. Press the Report function key to see the changed report:
    Figure 17. The report reflects the changes you made.
     REPORT                                           LINE 1      POS 1      79
     
                               TOTAL COMMISSIONS - CLERKS
     
     
       EMPLOYEE    DEPT
         NAME     NUMBER  JOB        SALARY   COMMISSION
       ---------  ------  -----  ----------  -----------
       JAMES          20  CLERK    13504.60       128.20
       NGAN           15  CLERK    12508.20       206.60
       NAUGHTON       38  CLERK    12954.75       180.00
       YAMAGUCHI      42  CLERK    10505.90        75.60
       KERMISCH       15  CLERK    12258.50       110.10
       ABRAHAMS       38  CLERK    12009.75       236.50
       SNEIDER        20  CLERK    14252.75       126.50
       SCOUTTEN       42  CLERK    11508.60        84.20
       LUNDQUIST      51  CLERK    13369.80       189.65
       WHEELER        51  CLERK    14460.00       513.30
       BURKE          66  CLERK    10988.00        55.50
       GAFNEY         84  CLERK    13030.50       188.00
     1=Help         2=            3=End       4=Print       5=Chart        6=Query
     7=Backward     8=Forward     9=Form     10=Left       11=Right       12=
     OK, REPORT is displayed.
  8. Press the End function key to return to the QMF Home panel.


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