Single Row Image in HTML Document
Leave feedback
NoteIn this article, we will use GroupDocs.Assembly to generate a Single Row Image report in HTML Document format.
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.
<table>
<tr>
<td>
<img height="100" width="100" src="data:image/jpeg;base64,<<[customer.Photo]>>"/>
</td>
<td>
<table>
<tr>
<td>
<b>Name:</b>
</td>
<td>
<b><<[customer.CustomerName]>></b>
</td>
</tr>
<tr>
<td>
<b>Contact Number:</b>
</td>
<td>
<<[customer.CustomerContactNumber]>>
</td>
</tr>
</table>
TipFor detailed technical information about syntax, expressions and report generation by the engine, please visit: Working with GroupDocs.Assembly Engine.
Please download the single row image document we created in this article:
NoteThe 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]
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.