Common Master-Detail in Text Document

Note
In this article, we will use GroupDocs.Assembly to generate a Common Master-Detail report in Text Document format.

Common Master-Detail in Text Document

Note
This feature is supported by version 17.3.0 or greater.

Reporting Requirement

As a report developer, you are required to represent the information of the customers and products with the following key requirements:

  • It must associate the customers with their products
  • Report must be generated in the HTML Document

Adding Syntax to be evaluated by GroupDocs.Assembly Engine

<<foreach [in customers]>><<[CustomerName()]>>
Products: <<foreach [in Order]>><<[indexOf() != 0 ? ", " : ""]>><<[Product.ProductName]>><</foreach>>
<</foreach>>
Tip
For detailed technical information about syntax, expressions and report generation by the engine, please visit: Working with GroupDocs.Assembly Engine.

Download Common Master-Detail Template

Please download the sample Common master-detail document we created in this article:

Generating The Report

Note
The code uses some of the objects defined in: The Business Layer
//For complete examples and data files, please go to https://github.com/groupdocs-assembly/GroupDocs.Assembly-for-.NET
//Setting up source text document template
const String strTxtDocumentTemplate = "Text Templates/Common Master-Detail.txt";
//Setting up destination text document report
const String strTxtDocumentReport = "Text Reports/Common Master-Detail Report.txt";
try
{
//Instantiate DocumentAssembler class
DocumentAssembler assembler = new DocumentAssembler();
//Call AssembleDocument to generate Common Master-Detail Report in text document format
assembler.AssembleDocument(CommonUtilities.GetSourceDocument(strTxtDocumentTemplate), CommonUtilities.SetDestinationDocument(strTxtDocumentReport), DataLayer.PopulateData(), "customers");
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}

Close
Loading

Analyzing your prompt, please hold on...

An error occurred while retrieving the results. Please refresh the page and try again.