Page tree
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 9 Next »

Table of Contents

Intro

Icon

This is Part 2 of a 2-part tutorial series for the Sales Invoice scenario. It is recommended that you complete Part 1 - Getting Started before starting this section.

Following the Sample

Icon

There is a downloadable ADD FILE REF with completed templates and code. The completed example of the template is available under templates/Part2_Invoice_Template.xlsx. The code for this part of the tutorial can be found in Part2.aspx.cs.

This part focuses on adding repeating data to an order summary. There are slight modifications to the template and code from Part 1.

Adding Repeat Blocks

The starting template is from Part 1 - Getting Started:

Repeat blocks are used to import multiple rows.  A repeat block is a fragment in the template document - defined by a Word bookmark - that contains merge fields and that will be repeated for each row in a data source. To import multiple rows from a single data source, create a repeat block in the template and, in the WordWriter code, call SetRepeatBlock to bind the repeat block to a data source.

In this sample, the repeat block is added to the order info merge fields. This bookmark is called "Repeat."

1. Add a bookmark around the data you wish to import.

2. In the code behind, call WordTemplate.SetRepeatBlock. Note that the dataset is bound with the bookmark name as an argument.

The final output should resemble this:

Final Code

Icon

For information on writing this code, see Part 1 - Getting Started .

Downloads

You can download the code for the Basic WordWriter Tutorials as a Visual Studio solution, which includes the Simple Expense Summary.

  • TODO: Add Link
  • No labels