TITLE:      Merging to a Table
PRODUCT:    WordPerfect 5.1 for DOS


Problem
You want the results of a merge to be placed in a table.


Solution
We have created two different primary files to show examples of
merging to different types of tables.  Two examples follow.

Example 1
This table will have one record on each row.

NAMEADDRESSCITYSTATEPHONE{LABEL}loop~
{FIELD}1~{FIELD}2~{FIELD}
3~{FIEL
D}4~ {FIELD}5~{NEXT
RECORD}{GO}loop~
The fourth row was created to avoid copying double lines between
each row when executing the merge.

To create the primary file, 

1     Press Columns/Table (Alt+F7), then choose Tables (2), and
      Create (1).

2     Type 5 for the number of columns and 4 for the number of
      rows.  (Remember that these numbers are for our example.  If
      you are creating your own table, change the numbers
      accordingly.)

3     Choose Header (4).  Type 1 and press Enter to specify one
      header row.  

Defining row 1 as a header will include column headings for each
merged page if the table exceeds one page.

4     Press Exit (F7) to return to the document screen.

5     Type the column headings for the table in the first
      row.  

6     Move the cursor to cell A2, which is the first line that
      will contain merged information.  Press Merge Codes
      (Shift+F9).

7     Choose More (6), then type L to search for the {LABEL}
      command.  Press Enter when {LABEL} is highlighted.  

8     Type loop to name the label, then press Enter.  

You now need to place the merge codes for each field in the
appropriate cells of row 2.

9     Press Merge Codes (Shift+F9), then choose Field (1).  Type
the field number, then press Enter. 

10    Press Tab to move to the next cell.

Repeat steps 9 and 10 until you have added all the fields for
your table.

11    Leave your cursor in the last column of row 2, after the
{FIELD} command.

12    Press Merge Codes (Shift+F9), then choose Next Record (5).

13    Move your cursor to cell A3.

14    Press Merge Codes (Shift+F9), then choose More (6). 

15    Type G to search for the {GO} command.  Press Enter to
      select {GO}. 

16    Type loop (you named the label "loop" in step 8).  Press
      Enter.

17    Press Save (F10) and save this primary file.

You are now ready to merge this primary file with your secondary
file. 


Example 2
Each record will be in a separate cell in this table.

CUSTOMER #1CUSTOMER #2CUSTOMER #3{LABEL}loop~{FIELD}
1~
{FIELD}2~
{FIELD}3~{NEXT
RECORD}{FIELD}1~
{FIELD}2~
{FIELD}3~{NEXT
RECORD}{FIELD}1~
{FIELD}2~
{FIELD}3~{NEXT
RECORD}{GO}loop~
Again, the last row was created to avoid copying double lines
between each row when executing the merge.

To create the primary file, 

1     Press Columns/Table (Alt+F7), then choose Tables (2), and
      Create (1).

2     Type 3 for the number of columns and 3 for the number of
      rows.  (Remember that these numbers are for our example.  If
      you are creating your own table, change the numbers
      accordingly.)

3     Choose Header (4).  Type 1 and press Enter to specify one
      header row.

Defining row 1 as a header will include column headings for each
merged page if the table exceeds one page.

4     Press Exit (F7) to return to the document screen.

5     Type the column headings for the table in the first
      row.  

6     Move the cursor to cell A2, which is the first line that
      will contain merged information.  Press Merge Codes
      (Shift+F9).

7     Choose More (6), then type L to search for the {LABEL}
      command.  Press Enter when {LABEL} is highlighted.  

8     Type loop to name the label, then press Enter.  

You now need to place the merge codes for each field in the
appropriate cells of row 2.

9     Press Merge Codes (Shift+F9), then choose Field (1).  Type
the field number, then press Enter. 

10    Press Enter again to place a hard return within the cell. 
      Then press Merge Codes (Shift+F9) and choose Field (1). 
      Type the next field number, then press Enter.

Repeat steps 9 and 10 until you have added all of the fields for
the record in that cell.

11    Press Tab to move your cursor to the next cell.  Press Merge
Codes (Shift+F9) and choose Next Record (5).

Repeat steps 9 through 11 until you have placed merge codes in
all columns.  The last {NEXT RECORD} command will be in cell A3. 
Leave your cursor in cell A3.

12    Press Merge Codes (Shift+F9), then choose More (6). 

13    Type G to search for the {GO} command.  Press Enter to
      select {GO}. 

14    Type loop (you named the label "loop" in step 8).  Press
      Enter.

15    Press Save (F10) and save this primary file.

You are now ready to merge this primary file with your secondary
file. 
