|
How to Create Word Reports
> Adding Merge Fields
Adding Merge Fields
An OfficeWriter Word template is a Word file that contains
merge fields. A merge field is a placeholder
for database values. When the report is published, OfficeWriter
will replace the merge fields with data from the database.
The format of a merge field is:
<<DatabaseQueryName.FieldName>>
For example, this merge field is a placeholder for values
from the "Last Name" field in the data set returned by a query called
"Employees":
<<Employees.LastName>>
The template shown below contains three merge fields.
A query's range may be either Document or Selection.
If a query is set to Document range, only the first row of data is returned from the query.
If a query is bound to a Selection within the document - a text fragment, list, or table row -
the query will return all the rows to the report and the selected text will be repeated
for each row returned from the database.
Adding Selection Merge Fields

- Place your cursor at the point in the document where you
want to insert the merge field.
- On the OfficeWriter toolbar, click Insert Merge Field and
select a field.
- Repeat steps 1 and 2 to insert additional merge fields.
- Highlight the set of merge fields that you want to repeat
for each row of data returned by the query.
- Select Query Range from the OfficeWriter toolbar.
- Make sure that Selection is chosen and click Ok.
Adding Document Merge Fields

- From the OfficeWriter Designer's
Select Query drop-down, select a query.
- Click Query Range.
- In the dialog, select Document. Click Ok.
- Place your cursor at the point in the document where you
want to insert the merge field.
- On the OfficeWriter toolbar, click Insert Merge Field and
select a field.
- Repeat steps 1 and 2 to insert additional merge fields.

Copyright 2006 © SoftArtisans, Inc. All Rights Reserved.
|