Merging Images into Image Placeholders
Merging images is a very simple task using the Text Control ReportingCloud Web API. Using the online template editor, you can add image placeholders into your template document. These placeholders can be bound to values in your JSON data source.
Creating a Template with Image Placeholders
In order to create a template with an image placeholder, follow these simple steps:
-
The JSON data must contain the image binary data encoded as a Base64 string. The image can be of type JPG, PNG, BMP and GIF. In your ReportingCloud Portal, click on My Datasource Excerpts and create a new datasource excerpts file by pasting the following JSON into the Datasource Excerpt text box:
Confirm the creation with Create Excerpt.
-
Click on My Templates and create a new template by clicking New Template. Type in a document name, select your preferred document format such as DOCX and confirm with OK.
-
Confirm the next dialog with Edit Template and select the created JSON excerpt file created in step 1 using the Select datasource excerpt file drop-down box. Open the template editor by clicking Edit Template:
-
Choose Image Placeholder from the Image drop-down from the Insert ribbon tab:
-
Right-click the image and open the Select Object Data Source drop-down box. Select Master -> image as the data source to bind the placeholder to the data column in the excerpt file.
-
Click Preview Merge Fields in the Reports ribbon tab and confirm the opened dialog box with OK:
When merging your template with JSON data using the Web API, the image data must be provided in the same way like in the excerpt file.