Skip to main content

Introduction to Looping Tag Types

What Are Looping Tags?

Looping Tags allow you to iterate over a set of data — rows from a database query, nodes from an XML or JSON file, etc. — and repeat a section of your template for each item. They are essential for building dynamic documents like invoices, reports, and lists where the number of items varies at generation time.

Every Looping Tag works as a pair: a begin tag and an end tag. Everything between the two tags is repeated once for each row or node in your data set. Inside the loop, you place Out Tags (Text, Date, Number, Out) to display the data for each iteration.

The Four Looping Tag Types

Fluent Designer provides four Looping Tag types. They all iterate over a data set, but each is optimized for a specific layout direction or use case.

BeginRepeat Tag

The BeginRepeat Tag (paired with an EndRepeat Tag) is the most straightforward looping tag. It repeats everything between the begin and end tags for each row or node in your data set, expanding row by row.

The BeginRepeat Tag can be used both inside and outside of tables, making it the most flexible option. Use it to repeat paragraphs of text, entire table rows, or mixed content that includes both text and tables.

When to use it: Repeating rows in a table, repeating paragraphs or sections of content, or any general-purpose loop that expands vertically.

RowExpand Tag

The RowExpand Tag (paired with an EndRowExpand Tag) also expands row by row, but it is designed specifically for use inside tables. It provides additional table-aware features like the block property, which lets you expand data in a contiguous block of cells while preserving surrounding table content — even allowing side-by-side loops in the same table.

When to use it: Expanding rows inside a table, especially when you need precise control over how table cells are preserved around the expanded data, or when running multiple loops side by side in the same table.

ColumnExpand Tag

The ColumnExpand Tag (paired with an EndColumnExpand Tag) works like RowExpand, but expands column by column instead of row by row. Each iteration adds new columns to your table rather than new rows. This is ideal for scenarios where your data categories are dynamic and need to spread horizontally.

The ColumnExpand Tag can only be used inside tables.

When to use it: Building tables where the number of columns is determined by your data, such as monthly breakdowns, category comparisons, or pivot-style layouts.

ForEach Tag

The ForEach Tag (paired with an End ForEach Tag) is the most powerful and configurable looping tag. It supports all the functionality of the other three tags through its order property:

  • legacy or row — expands row by row (like BeginRepeat and RowExpand)
  • column — expands column by column (like ColumnExpand)

It also includes the block property for side-by-side table expansion and exposes advanced configuration options. The BeginRepeat, RowExpand, and ColumnExpand Tags are simplified, use-case-specific versions of the ForEach Tag.

When to use it: When you need full control over loop behavior, or when working with advanced properties not available on the simplified tags.

How Do I Use a Looping Tag?

  1. Connect to a data source — Connect your template to a data source using the Fluent Designer ribbon.
  2. Insert a looping tag — Use the Fluent Designer ribbon or the Data Bin to insert a looping tag. This places both the begin and end tags in your template.
  3. Add Out Tags inside the loop — Between the begin and end tags, place Text, Date, Number, or Out Tags to display data fields for each iteration.
  4. Configure properties — Open the Tag Editor to set properties like nickname, var, varStatus, and block as needed.
  5. Generate output — Use the Output button on the Fluent Designer ribbon to generate your document and see the repeated data.
tip

For most table-based layouts, RowExpand is the recommended choice. Use BeginRepeat when you need to loop content outside of a table. Use ColumnExpand when your data should expand horizontally. Use ForEach when you need advanced options.

How Do These Tags Relate to Each Other?

The BeginRepeat, RowExpand, and ColumnExpand Tags are simplified versions of the ForEach Tag, each pre-configured for a common use case:

TagEquivalent ForEach SettingExpand DirectionWorks Outside Tables?
BeginRepeatorder = legacyRow by rowYes
RowExpandorder = rowRow by rowNo
ColumnExpandorder = columnColumn by columnNo
ForEachConfigurableEither directionDepends on order

Learn More

For a complete breakdown of all properties and configuration options, see the ForEach Tag Reference.

You can also view the individual tag reference articles for more details: