Mixing tabular data with reformatted text

Complete the following tasks to mix tabular data and reformatted text within blocks of text.

Procedure

  1. Run the query and display the report.
    For this example, run the following SQL query:
    SELECT ACCTNO, COMPANY, NOTES
      FROM Q.SUPPLIER
  2. On the QMF command line, enter:
    SHOW FORM.COLUMNS
    For this example, make the following changes on the FORM.COLUMNS panel:
    1. Specify an OMIT usage code for all columns except the NOTES column, because the NOTES column is the only column you will be displaying as tabular data.
    2. Change the edit code for the NOTES column to CT, to allow text wrapping within the column, and change the width to 40.
  3. On the QMF command line, enter:
    SHOW FORM.DETAIL
  4. Make the following changes on the FORM.DETAIL panel:
    1. In the Include Column Headings with Detail Headings? field, type NO so that the column headings will not appear after the detail heading text.
    2. In the Blank Lines after Block field, type 6.
    3. Specify the line number on which you want to display the tabular data in the Put Tabular Data at Line field. Specify different line numbers for the detail block text and the tabular data, or one will overlay the other when you display the report. For this example, type 4.
    4. Type the information for the detail block text. For this example, type Company: &2 for the first line because COMPANY is the second column that appears in the SELECT statement of the query. Type Account Number: &1 for the second line, because ACCTNO is the first column in the SELECT statement. Type Notes: for the third line.

      The following figure shows these changes. You do not have to specify a form variable for the tabular data; the data will follow the last line of detail block text.

    For more information on specifying detail block text, see the following figure.
    Figure 1. Specifying placement of tabular data with detail block text
     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
                   *** END ***
     
     New Page for Detail Block? ===> NO      Repeat Detail Heading?  
     ===> NO
     Keep Block on Page?        ===> NO      Blank Lines after Block 
     ===> 6
     Put Tabular Data at Line (Enter 1-999 or NONE) ===> 4
     LINE  ALIGN   DETAIL BLOCK TEXT
     ----  ------  ----+----1----+----2----+----3----+----4----+----5----+
     1     LEFT    COMPANY:  &2;
     2     LEFT    ACCOUNT NUMBER:  &1;
     3     LEFT    NOTES:
     
     Select Panel Variation?    ===> NO
     
  5. Press the Report function key to see the changed report, which is shown in the following figure.
    Figure 2. The changed report shows tabular data mixed with a detail block.
    COMPANY: WESTCO, INC.
     ACCOUNT NUMBER: 1100P
     NOTES:
       THIS COMPANY HAS A STRONG HISTORY OF
       ON-TIME DELIVERY.  WESTCO IS GROWING
       QUICKLY.

Results

When you omit some columns from the report, as in this example, you reduce the automatic total width of the report. Make sure that your report is wide enough to include all of the detail block text. Change the width of your report by changing the Report text line width field on the FORM.OPTIONS panel.