In-Paragraph List in Text Document

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

In-Paragraph List in Text Document

Reporting Requirement

As a report developer, you are required to describe about the services you are providing with the following key requirements:

  • A descriptive or informative line like “We provide support for the following products:”.
  • Show all the products along with the above sentence.
  • Report must be generated in the text Document.

Adding Syntax to be evaluated by GroupDocs.Assembly Engine

We provide support for the following products:
<<foreach [in products]>><<[IndexOf() != 0 ? ", " : ""]>>
<<[ProductName]>>
<</foreach>>
Tip
For detailed technical information about syntax, expressions and report generation by the engine, please visit: Working with GroupDocs.Assembly Engine.

Download In-Paragraph List Template

Please download the sample Common List document we created in this article:

Generating The Report

Note
The example reads the shop data described in The Business Layer.
import json

from groupdocs.assembly import DataSourceInfo, DocumentAssembler

with open("products.json", encoding="utf-8") as f:
    products = json.load(f)

assembler = DocumentAssembler()
assembler.assemble_document("in-paragraph-list.txt", "in-paragraph-list-report.txt", DataSourceInfo(products, "products"))

The following sample file is used in this example: in-paragraph-list.txt

The following sample file is used in this example: products.json

We provide support for the following products: Harbor Blend whole bean coffee, Lighthouse Espresso beans, Aged harbour cheddar, Chestnut honey, Oat and honey biscuits, Cold-pressed olive oil, Smoked sea salt, Smoked gouda, Autumn Harvest apple butter, Autumn Harvest spiced roast

Download full output

Close
Loading

Analyzing your prompt, please hold on...

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