Mixing tabular data with reformatted text
Complete the following tasks to mix tabular data and reformatted text within blocks of text.
- Run the query and display the report. For this example, run the following SQL query:
SELECT ACCTNO, COMPANY, NOTES FROM Q.SUPPLIER
- On the QMF command
SHOW FORM.COLUMNSFor this example, make the following changes on the FORM.COLUMNS panel:
- 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.
- Change the edit code for the NOTES column to CT, to allow text wrapping within the column, and change the width to 40.
- On the QMF command
- Make the following changes on the FORM.DETAIL panel:
For more information on specifying detail block text, see the following figure.
- In the Include Column Headings with Detail Headings? field, type NO so that the column headings will not appear after the detail heading text.
- In the Blank Lines after Block field, type 6.
- 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.
- 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.
- Press the Report function key to see the changed report,
which is shown in the following figure.
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.