Products Technologies Demo Docs Blog Support Company

Reporting Tutorial: Repeating Blocks with Related Sub Tables

Creating product lists or sales reports is a common application for TX Text Control's reporting engine MailMerge. Repeating table rows, where related detail information is listed in sub tables, are typical elements of such reports. The following screenshot illustrates such a list: Creating those master-detail views is a very easy task using TX Text Control. Master-detail interfaces display a master list and details for the current item. Think of a product list divided into categories where…

Reporting Tutorial: Repeating Blocks with Related Sub Tables

Creating product lists or sales reports is a common application for TX Text Control's reporting engine MailMerge. Repeating table rows, where related detail information is listed in sub tables, are typical elements of such reports. The following screenshot illustrates such a list:

Repeating blocks with related sub tables

Creating those master-detail views is a very easy task using TX Text Control. Master-detail interfaces display a master list and details for the current item. Think of a product list divided into categories where all products are listed in a sub table under the specific category.

This basic tutorial shows how to create such a list based on the sample database that comes with TX Text Control Words - the shipped template designer. At the end of this tutorial, the following template will be created that can be directly tested with the sample database:

Repeating blocks with related sub tables
  1. Open TX Text Control Words. In the Mailings ribbon tab, click the Load Sample Database menu item from the Select Data Source drop-down button.

    Repeating blocks with related sub tables
  2. From the Merge Blocks ribbon group, open the Insert Merge Block drop-down button and select Sales_SalesOrderDetail to insert a merge block.

    Repeating blocks with related sub tables
  3. In the opened dialog box, select OrderQty, UnitPrice and LineTotal from the available table colums. Check the Add table header row check box and confirm with OK.

    Repeating blocks with related sub tables
  4. The following formatted merge block is inserted into the document:

    Repeating blocks with related sub tables
  5. Set the input position into the second table row and choose Insert Below from the Rows & Columns ribbon group of the Table Tools contextual ribbon group.

    Repeating blocks with related sub tables
  6. Insert a second row, change the background color of the new table rows and indent the first column. Additionally, add column names to the first blue table row.

    Repeating blocks with related sub tables
  7. Set the input position into the second row of the blue table rows and choose Sales_SalesOrderDetail from the Insert Merge Field drop-down button.

    Repeating blocks with related sub tables
  8. In the opened dialog box, expand the Production_Product node in the tree view, select Name and confirm with Insert Field. This dialog shows all related sub tables and their available field names.

    Repeating blocks with related sub tables

    Repeat this step for the next column ProductNumber.

  9. Set the input position into the third column of the new blue row and choose Image Placeholder from the Image drop-down button of the Insert ribbon group.

    Repeating blocks with related sub tables
  10. Scale down the image placeholder that should fit into the table cell. Right-click the image placeholder and select Sales_SalesOrderDetail from the context menu item Select Object Data Source.

    Repeating blocks with related sub tables
  11. In the opened dialog box, expand the nodes until you reach Production_ProductPhoto, select ThumbNailPhoto and confirm with Insert Field.

    Repeating blocks with related sub tables
  12. Right-click the image again and set the Text Wrapping to In Line.

    Repeating blocks with related sub tables
  13. Choose Preview Merge Fields from the Mailings ribbon tab to start the merge process. In the opended dialog box, confirm the number of preview records with OK.

    Repeating blocks with related sub tables

You can download the sample template and load it into the shipped sample TX Text Control Words.

Try TX Text Control Reporting yourself!
Download the TX Text Control Trial version today.

Download Trial

Or Simply Call Us to Learn More:

United States

+1 704 544 7445 (US)

Europe - Germany

+49 421 427067 10 (Europe)

Stay in the loop!

Subscribe to the newsletter to receive the latest updates.

Reporting

The Text Control Reporting Framework combines powerful reporting features with an easy-to-use, MS Word compatible word processor. Users can create documents and templates using ordinary Microsoft Word skills. The Reporting Framework is included in all .NET based TX Text Control products including ASP.NET, Windows Forms and WPF.

See Reporting products

Related Posts

ASP.NETReportingHTML5

Creating Your First ASP.NET Reporting Application

This tutorial shows how to use the MailMerge component in an ASP.NET Web application to merge a template with data to create an Adobe PDF document.


ASP.NETReportingTutorial

New Online Sample: Build your First Report

We published a new online demo that shows how to create a report including preparing data, creating a template to merging them together.


ReportingDocumentationReportingCloud

Create your First Document with ReportingCloud

As part of our new ReportingCloud documentation, we published a guided tutorial that shows how to create a document without programming.


CloudReportingMail Merge

MailMerge: Starting Each Merge Block on a New Page

A merge block is repeated based on the number of matching data rows in the hierarchical data object. The complete merge block is cloned and inserted under the original location in the template.…


ReportingTutorialWeb API

Using MailMerge with JSON Data

In the last article, we explained how to create an ASP.NET Web API to merge templates with JSON data in the payload body of an HTTP request. The focus of this article was on the Web API and…