Numbered List in Text Document

View as MarkdownMarkdown

Set up your AI agent

Give your coding agent live access to the GroupDocs documentation and API reference through the GroupDocs Docs MCP server — no install, no API key. Learn more

claude mcp add --transport http groupdocs-docs https://docs.groupdocs.com/mcp

Also process documents locally

The GroupDocs.Assembly MCP server lets your agent work with files on your machine; they are never uploaded. It needs the .NET 10 SDK or Docker.

claude mcp add groupdocs-assembly -- dnx GroupDocs.Assembly.Mcp --yes
Folders, licensing and more →

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

Numbered List in Text 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 the numbered list.
  • The 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]>><<[NumberOf()]>>. <<[ProductName]>>
<</foreach>>
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.txt", "numbered-list-report.txt", DataSourceInfo(products, "products"))

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

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

We provide support for the following products:
1. Harbor Blend whole bean coffee
2. Lighthouse Espresso beans
3. Aged harbour cheddar
4. Chestnut honey
5. Oat and honey biscuits
6. Cold-pressed olive oil
7. Smoked sea salt
8. Smoked gouda
9. Autumn Harvest apple butter
[TRUNCATED]

Download full output