Single Row Image in HTML Document

Note
In this article, we will use GroupDocs.Assembly to generate a Single Row Image report in HTML Document format.

Single Row Image in HTML Document

Reporting Requirement

As a report developer, you are required to represent information of first single customer with the following key requirements:

  • Report must show image of the customer
  • It must show Name and Contact Number of the customer
  • Report must be generated in the Presentation Document.

Adding Syntax to be evaluated by GroupDocs.Assembly Engine

<table>
<tr>
<td>
<img height="100" width="100" src="data:image/jpeg;base64,&lt;&lt;[customer.Photo]&gt;&gt;"/>
</td>
<td>
<table>
<tr>
<td>
<b>Name:</b>
</td>
<td>
<b>&lt;&lt;[customer.CustomerName]&gt;&gt;</b>  
</td>
</tr>
<tr>
<td>
<b>Contact Number:</b>
</td>
<td>
&lt;&lt;[customer.CustomerContactNumber]&gt;&gt;
</td>
</tr>
</table>
Tip
For detailed technical information about syntax, expressions and report generation by the engine, please visit: Working with GroupDocs.Assembly Engine.

Download Single Row Image Template

Please download the single row image 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("customer.json", encoding="utf-8") as f:
    customer = json.load(f)

assembler = DocumentAssembler()
assembler.assemble_document("single-row.html", "single-row-report.html", DataSourceInfo(customer, "customer"))

The following sample file is used in this example: single-row.html

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

The following sample files are used in this example: quayside-bistro.png, lantern-street-cafe.png, saltmarsh-deli.png, pier-nine-kitchen.png

<html>
<body>
<table>
<tr>
<td>
<img height="100" width="100" src="data:image/jpeg;base64,quayside-bistro.png"/>
</td>
<td>
<table>
<tr>
[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.