Common Master-Detail in Text Document
Leave feedback
NoteIn this article, we will use GroupDocs.Assembly to generate a Common Master-Detail report in Text Document format.
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
<<foreach [in customers]>><<[CustomerName()]>>
Products: <<foreach [in Order]>><<[indexOf() != 0 ? ", " : ""]>><<[Product.ProductName]>><</foreach>>
<</foreach>>
TipFor detailed technical information about syntax, expressions and report generation by the engine, please visit: Working with GroupDocs.Assembly Engine.
Please download the sample Common master-detail document we created in this article:
NoteThe example reads the shop data described in The Business Layer.
import json
from groupdocs.assembly import DataSourceInfo, DocumentAssembler
with open("customers.json", encoding="utf-8") as f:
customers = json.load(f)
assembler = DocumentAssembler()
assembler.assemble_document("common-master-detail.txt", "common-master-detail-report.txt", DataSourceInfo(customers, "customers"))
The following sample file is used in this example: common-master-detail.txt
The following sample file is used in this example: customers.json
Quayside Bistro
Products: Harbor Blend whole bean coffee, Aged harbour cheddar, Cold-pressed olive oil
Lantern Street Café
Products: Lighthouse Espresso beans, Oat and honey biscuits
Saltmarsh Deli
Products: Chestnut honey, Smoked gouda, Autumn Harvest apple butter
Pier Nine Kitchen
[TRUNCATED]
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.