In-Paragraph List in HTML Document

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

In-Paragraph List in HTML Document

Reporting Requirement

As a report developer, you are required to describe 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 HTML 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.html", "in-paragraph-list-report.html", DataSourceInfo(products, "products"))

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

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

<html>
<body>
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
</body>
</html>

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.