Interactive designer
Build a nested data table
Select a parent data block, include its child blocks, and decide which fields each table level displays.
-
1
Design the hierarchy
Create a table whose nested merge blocks follow the JSON relationships.
-
2
Preview the merged result
Merge all invoice records or return to the editable template.
Ready to tryUse the controls above to interact with this demo.
What this demonstrates
Nested blocks mirror nested data
A merge block repeats once for each record in its data table. A child block belongs inside its parent block and repeats only for the child records of the current parent row.
Template API
DataSourceManager.InsertMergeBlock
Merge API
MailMerge.MergeJsonData
How the hierarchy is stored
TX Text Control represents a reporting block as a subtextpart whose name starts with txmb_. The controller creates a recursive MergeBlockInfo tree: every item in ChildBlocks becomes a smaller subtextpart inside its parent. The selected ColumnNames become merge fields at that level, so parent fields remain outside their child blocks.
How the sample JSON maps to blocks
Sales_SalesOrderDetail is the outer repeating order-detail table. Its Production_Product object can be inserted as a nested block, and Production_ProductProductPhoto can form a third level. During the merge, each inner block is evaluated in the context of its current parent record.