Numbered List in HTML Document

Note
In this article, we will use GroupDocs.Assembly to generate a Numbered List report in HTML Document format.
Note
The example reads the shop data described in The Business Layer.

Numbered 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:

  • The report must show the products in numbered list.
  • The report must be generated in the HTML Document.

Adding Syntax to be evaluated by GroupDocs.Assembly Engine

We provide support for the following products:
<ol>
&lt;&lt;foreach [in products]&gt;&gt;
<li>&lt;&lt;[ProductName]&gt;&gt;</li>
&lt;&lt;/foreach&gt;&gt;
</ol>
Tip
For detailed technical information about syntax, expressions and report generation by the engine, please visit: Working with GroupDocs.Assembly Engine.

Download Numbered List Template

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

Generating The Report

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("numbered-list.html", "numbered-list-report.html", DataSourceInfo(products, "products"))

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

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

<html>
<body>
We provide support for the following products:
<ol>

<li>Harbor Blend whole bean coffee</li>

<li>Lighthouse Espresso beans</li>

<li>Aged harbour cheddar</li>
[TRUNCATED]

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.