Alright, so you have a set of images (say a few company Logos) that you want to display dynamically in your report based on some criteria.
Let's see how to achieve this in ERP Cloud BI Publisher.
- First step is to convert convert the image file(s) into base64 encoding. You can use any open source web based tool to convert a given image and retrieve it's corresponding Base64 data.
- Now you should have the base64 encoding representation of the image(s).
For example the following image has the below base64 representation -
Image -
Base64 data - - Create the data model that decides which image should be displayed for a particular set of data depending on the required conditions and ensure to select the actual Base64 data as one of the XML tags.
- Now, let's see how we can convert Base64 information in RTF and display it as an image.
- This can be done using "foreign object" construct like this -
<fo:instream-foreign-object content-type="image/jpg"><?IMAGE1?></fo:instream-foreign-object>
Here IMAGE1 is a tag containing Base64 data of the image in your XML output.
- XML data should look like this -
- Below is how your template will look like -
- And here's the output of your report showing the image dynamically -
0 comments:
Post a Comment