Products Technologies Demo Docs Blog Support Company

Reporting: Merge Blocks with MergeObjects

MergeObjects is used to merge a collection of IEnumerable objects. This blog article gives a good overview of how to use MergeObjects with typical business objects. The used template is described in detail in this entry. This article explains the merge block in detail. Based on the above sample, the merge block repeats all expenses in an expense report: The below class diagram shows the business object. The merge block data source LineItem and the property LineItems is highlighted: The…

Reporting: Merge Blocks with MergeObjects

MergeObjects is used to merge a collection of IEnumerable objects. This blog article gives a good overview of how to use MergeObjects with typical business objects. The used template is described in detail in this entry.

This article explains the merge block in detail. Based on the above sample, the merge block repeats all expenses in an expense report:

Merge blocks with MergeObjects

The below class diagram shows the business object. The merge block data source LineItem and the property LineItems is highlighted:

Merge blocks with MergeObjects

The complete report is repeated based on the number of passed objects of type Expense in the collection Expenses. The merge block name must match the property name LineItems:

Merge blocks with MergeObjects

In this sample, the repeating block consists of two similar table rows with same columns and merge fields, but a different background color to realize alternating colors. At the end of row 1, a NEXT field increases the current data row.

Merge blocks with MergeObjects

Text Control's Reporting engine MailMerge is trying to match merge block names with encapsulated class names in the business object automatically. Merge blocks can be nested in unlimited levels as well. You simply pass a pre-filled business object to MergeObjects and TX Text Control is doing the work for you.

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…