Printing Images in Reports

Description

Images stored in a database can be displayed in a report. This includes images stored as blob, base64, or image file reference fields as well as SVG and Ink data. Composite images can also be generated from picutre and ink data and shown in a report.

 Printing Image Fields in Reports

If you have images stored in a table as blob data, an image file reference, ink, or svg, you can display them in a report by overriding the Field Definition for the field.

In the Specify Data Source dialog, click on Advanced Options near the bottom of the dialog. On the Advanced Options dialog check Override field definitions of selected fields and press the Field Definitions button. In the Field Definitions dialog, select the image field and click the Edit field definition button. Select the desired type from the Data type dropdown. Supported data types for images are listed below:

Data type
Usage
Bitmap

For fields that contain a bitmap image. Field can be binary blob data or a character field containing a base64 encoded image.

Jpeg Image

For fields that contain a jpeg image. Field can be binary blob data or a character field containing a base64 encoded image.

PNG Image

For fields that contain a png image. Field can be binary blob data or a character field containing a base64 encoded image.

Image File Reference

For fields that are image file references. An image file reference is the path to where the image is stored.

SVG Image

For fields that contain SVG data.

Ink Image

For fields that contain Ink data.

 Printing base64 Encoded Images

Base64 images stored in a text field can be rendered as images in reports. You can do this by changing the field definition for the field from a character type to the appropriate image type: Bitmap, Jpeg Image, or PNG Image.

You can alternatively use an HTML object to embed the image into the report. Add a static HTML object to the report. Click the Edit button in the upper right-hand corner of the HTML object to edit the HTML.

Report HTML Object

In the HTML editor, add an <img> tag to the HTML source and set the src property to the field. For example, suppose you have a field in your database that contains a base64 encoded png image called "Base64Image":

<img src="data:image/png;base64,{Base64Image}" />

If the data prefix was included with the base64 encoding for the image field, you can omit the "data:image/png;base64," portion and just use the field in the HTML:

<img src="{Base64Image}" />

 Printing Annotated Images

Images can be annotated with Ink. The annotation is stored separately from the image. In order to display the image with annotations in the report, the two fields need to be combined into a composite image. The a5_composite_picture_and_ink Xbasic method can be used to create a composite image. The composite image can be stored in a calculated field, which can be placed in the Report.

annotatedPicture = a5_composite_picture_and_ink(imageField, inkField)

 Printing Signatures in a Report

The Signature Capture control in Alpha Anywhere captures and saves the signature as a PNG image. To display a Signature in a Report, override the field definition for the Signature field and set the Data type to PNG Image.

See Also