HTML Box
An HTML Box displays an image of an HTML document in the report.
HTML Box (HTMLBox type) is a layout container, found in the Drawables group in the Tool Box view.
Properties
Select the object on the Report Design page to display its properties in the Properties View.
Use the Location property to specify the file name and path of the HTML document.
Embedding HTML
To embed a document, use a URL type that allows encoding the data in the body of the URL text. The full syntax of data URLs is:
data:[MIME-type][;charset=encoding][;base64],data
See data URI scheme (Wikipedia link) for a complete description of the concept and the syntax.
For our purposes, it is sufficient to support a simplified subset that omits
the charset
and assumes that characters are encoded in UTF-8. Image data is always
encoded in base64 (Wikipedia link) while other data such as HTML content is typically “Percent
encoded” (Wikipedia link).
data:text/html, data
where data is the percent encoded data of the HTML document.
To embed HTML, use the data protocol syntax in the Location property of the HTMLBOX element.
To automatically construct this URL, click the ... button for the Location property. Choose the file and select the Embed in document check box:
Populating HTML content from text variables
Data in text variables is typically input into a database using a TextEdit form field, with the textFormat style attribute set to html. See the Presentation Styles topic in the Genero Business Development Language User Guide for more details.
Enter the code in the Expression Editor for the Location property of the HTML Box, including the name of the text variable.
To encode the data using percent encoding, use the function String.urlEncode().