Page tree

Versions Compared

Key

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

Introducedin
4.5
4.5

Note

Grouping and Nesting is only available in WordWriter EE.

Excerpt

Beginning in version 4.5, the WordTemplate object includes support for nested bookmarks with Office Open XML documents (.docx, .docm, .dotx, and .dotm) in WordWriter Enterprise Edition. Nested bookmarks can be used to format and display hierarchical data.

The Grouping Repeat Block

Grouping and Nesting with the WordTemplate object is a modification of existing Repeat Block and Mail Merge functionality used to import multiple rows. Standard repeat blocks and mail merges are not able to display data hierarchically because they cannot be nested. Grouping blocks resolve this problem by allowing you to nest a grouping block within a repeat block or a mail merge document, controlling which data will be repeated for each primary value.

...

With the outer bookmark named "Repeat" and the inner bookmark named "Groupcolumn_1", the following code can be used to bind data to the grouping block:

Code Block
csharp
csharp

wt.SetRepeatBlock("repeat", data);

...

Hierarchical data can be grouped and nested within Mail Merges as well as Repeat Blocks. The above sample could be created with a Mail Merge by simply deleting the "repeat" bookmark and using the following code to bind data:

Code Block
csharp
csharp

wt.SetMailMerge(data);

The resulting document will be the same, as SetMailMerge will treat the content of the page as if it were a repeat block.

...

Of course, further pages will continue the orders, and a new letter is composed for each customer.

Scrollbar