In-Table List with Highlighted Rows in HTML 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 In-Table List with Highlighted Rows in HTML Document format.
Note
The example reads the shop data described in The Business Layer.

In-Table List with Highlighted Rows in HTML Document

Reporting Requirement

As a report developer, you are required to represent customers’ orders information with a specific filtering condition with the following key requirements:

  • The report must show each customer along with his orders.
  • Show single Customer and his single order price in a single row.
  • It must highlight the record with order price more than or equal to 400.
  • It must show sum of the order prices.
  • It must represent all the information in tabular form.
  • The report must be generated in the Word Processing Document.

Adding Syntax to be evaluated by GroupDocs.Assembly Engine

Customer

Order Price

<<foreach [in orders]>><<if [Price >= 400]>><<[Customer.CustomerName]>>

<<[Price]>>

<<else>><<[Customer.CustomerName]>>

<<[Price]>><</if>><</foreach>>

Total:

<<[Sum(c => c.Price)]>>

Tip
For detailed technical information about syntax, expressions and report generation by the engine, please visit: Working with GroupDocs.Assembly Engine.

In-Table List with Highlighted Rows Template

Please download the In-Table list with highlighted rows template document we created in this article:

Generating The Report

import json

from groupdocs.assembly import DataSourceInfo, DocumentAssembler

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

assembler = DocumentAssembler()
assembler.assemble_document("in-table-list-with-highlighted-rows.html", "in-table-list-with-highlighted-rows-report.html", DataSourceInfo(orders, "orders"))

The following sample file is used in this example: in-table-list-with-highlighted-rows.html

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

<html>
<body>
<table>
<tr>
<th>
Customer
</th>
<th>
Order Price
</th>
[TRUNCATED]

Download full output