Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

A query's range may be either Document or Selection. If a query is set to Document range, In an OfficeWriter for Word report, data can be imported in two ways: at the Document level and in a Repeat Region (also known as a Repeat Block).

When data is imported at the Document level, the merge fields for the data set can appear anywhere in the document and only the first row of data is returned from the querydataset is imported. If a query dataset is bound set 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.

How to Set Query Range to Document

To set a query's range to Document:

  1. From the OfficeWriter Designer's Select Query drop-down, select the query.
    # Click the OfficeWriter Designer's Query Range button.
    # In the dialog, select Document.
    # Click Ok.

You may also set the query range to document when you first create the query. When you click Add Query the first screen you are presented with is the Query Range dialog box. Select Document from this screen.

Image Removed

How to Set Query Range to Selection

To set a query's range to Selection:

  1. Add merge fields to your report.
    # From the OfficeWriter Designer's Select Query drop-down, select the query.
    # Highlight the merge fields that you want to include in the selection.
    # Click the OfficeWriter Designer's Query Range button.
    # In the dialog, choose Selection.
    # Click Ok.
    !ww_qrnge2.jpg!

Examples

Here are the results of a Document range query:

Image Removed

Here are the results of the same query, with the query range set to Selection:

Image Removed

Selection Limitations

When you set a query to Selection rangeimport into a Repeat Region, a section of the document will repeat for each row of data in the dataset.

How to Import Data at the Document Level:

If you have not previously set the dataset to import into a Repeat Region, then you do not have to do anything. All data sets are considered to be set to Document Level by default.

If your dataset is set to import into a Repeat Region, you can change the dataset to be Document Level:

  1. Go to Merge Fields > the data set
  2. Under Repeat Region select Clear Repeat Region. This will set the dataset to import at the Document Level.

How to Import Data in a Repeat Region:

A Repeat Region, or Repeat Block, is a section of a document that will repeat for each row of data in a dataset. Popular repeat regions are sections of text or table rows. To denote a Repeat Region, OfficeWriter for Word places a specially-named bookmark around the section of the document that is to repeat.

The OfficeWriter Designer toolbar allows you to Set, Clear, and Show repeat regions.

How to Set a Repeat Region

  1. Add merge fields from a data set to your report.
    # Select the section of text (or table, list etc.) that you want to repeat for each row of data.
    # Go to Merge Fields on the OfficeWriter Designer toolbar. Locate the data set you want.
    # Under the Repeat Region section, select Set Selection to Repeat Region.
    \
    This will place the special bookmark around the section of the document.

How to Clear a Repeat Region

  1. Go to Merge Fields > the data set
  2. Under Repeat Region select Clear Repeat Region. This will set the dataset to import at the Document Level.

How to Show a Repeat Region

  1. Go to Merge Fields > the data set
  2. Under Repeat Region select Show Repeat Region. This will highlight the section that is currently set as the Repeat Region.

Repeat Region Limitations

When importing data into a Repeat Region, the following Word features cannot be included in the selected text fragment, list, or table row:

  • Nested selections (Only one data source may be assigned to a single selection.)
  • Overlapping selections
  • Comments
  • Drawing Objects
  • Text Boxes
  • Footnote and endnote references
  • Table and picture indexes
  • Single cell in a table
  • Smart tags (smart tags will be removed from the document)
  • Selections in headers, footers, footnotes, comments, text boxes, etc.

Examples

Here are the results of a Document range query:

Image Added

Here are the results of the same query, with the query range set to a Repeat Region:

Image Added