Common Master-Detail Image in HTML Document

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

Common Master-Detail Image in HTML Document

Note
This feature is supported by version 17.03 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:

  • Report must show customers’ picture and name.
  • 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 html template
const String strDocumentTemplate = "HTML Templates/Common Master-Detail.html";
//Setting up destination html report
const String strDocumentReport = "HTML Reports/Common Master-Detail Report.html";
try
{
//Instantiate DocumentAssembler class
DocumentAssembler assembler = new DocumentAssembler();
//Call AssembleDocument to generate Common Master-Detail Report in html format
assembler.AssembleDocument(CommonUtilities.GetSourceDocument(strDocumentTemplate), CommonUtilities.SetDestinationDocument(strDocumentReport), 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.