Products Technologies Demo Docs Blog Support Company

New Sample: Creating Reports with Nested Repeating Blocks

The TX Text Control .NET Server 16.0 MailMerge class merges nested repeating blocks by recursively traversing relational data structures defined through DataRelations. This sample builds an employee accruals report linking employee records to sick leave and vacation tables.

New Sample: Creating Reports with Nested Repeating Blocks
mailMerge1.LoadTemplateFromMemory(data,
            TXTextControl.DocumentServer.FileFormat.InternalUnicodeFormat);

// load the XML file
DataSet ds = new DataSet();
ds.ReadXml(tbDatabaseFile.Tag.ToString(), XmlReadMode.Auto);

// add the relations for the nested blocks
DataRelation relation_sick = new DataRelation("sick",
    ds.Tables["employee"].Columns["dyn_employee_number"],
    ds.Tables["sick"].Columns["dyn_employee_number"]);

DataRelation relation_vacation = new DataRelation("vacation",
    ds.Tables["employee"].Columns["dyn_employee_number"],
    ds.Tables["vacation"].Columns["dyn_employee_number"]);

ds.Relations.Add(relation_vacation);
ds.Relations.Add(relation_sick);

// pass the data
mailMerge1.MergeBlocks(ds);
mailMerge1.Merge(ds.Tables["general"], true);

Stay in the loop!

Subscribe to the newsletter to receive the latest updates.

Related Posts

ASP.NETASP.NET CoreMail Merge

Learning Mail Merge Templates from Basic Fields to Advanced Reporting Structures

The new Mail Merge Template Assistant transforms the TX Text Control online demo into an interactive tutorial. It guides developers through basic data binding and merge fields, as well as advanced…


ASP.NETBlazorASP.NET Core

TX Text Control for Blazor: Mail Merge Integration Tutorial

This tutorial shows how to integrate the TX Text Control MailMerge component into a Blazor application using the TX Text Control .NET Server.


ASP.NETASP.NET CoreMail Merge

Mail Merge: Skipping Records During the Merge Process in .NET C#

This article shows how to skip records during the merge process in .NET C# using the MailMerge class of the Text Control Reporting engine.


ASP.NETASP.NET CoreMail Merge

Mail Merge MS Word DOCX Documents and Convert to PDF in .NET C#

This article shows how to merge data into MS Word DOCX documents and convert them to PDF using TX Text Control .NET Server.


ASP.NETASP.NET CoreMail Merge

Merging Self-Calculating Business Objects with TX Text Control MailMerge in C#

This article shows how to merge self-calculating business objects with TX Text Control MailMerge in C#. The sample shows how to merge a list of products with a total sum.

Share this blog post on: