Sunday, 26 April 2020

How to display blob image in xml Publisher

How to display blob image in xml Publisher

In this post , we will be discuss about how to display blob image in XML Publisher. In XML publisher , we have the options to display the blog image dynamically. We can display the blob images from DB tables in to the xml publisher. Here below , i will share the detail steps to display blob image in xml Publisher.

How to display blob image in xml Publisher
How to display blob image in xml Publisher

Syntax to Display blob image in xml Publisher

Here below is the syntax to retrieve BLOB from database:

Step1:-   Remove the blob from the XML data source.

Note: As of XMLP data engine version 5.6.2 the extraction of blob images can be done directly into the XML. Its pulled out and stored in a base64 format there is no limit on the size of the BLOB i.e. you can get more than 64K of data out in the encoded format. There are other methods to get the data out but it must be base64 encoded.

Step2:-   Reference the BLOB. In the template, reference the image data.

Note: You can use an XSLFO expression to reference the image:
<fo:instream-foreign-object content-type="image/jpg">
<xsl:value-of select="IMAGE_ELEMENT"/>
</fo:instream-foreign-object>
Notice the template needs to know the mime type of the image, in this case "image/jpg"
The IMAGE_ELEMENT contains the base64 encoded image data. Template and sample data here.
So at run-time the image is brought into the output.

Working Example to display blob image in xml Publisher

For Example in purchase order report in which you want to display item images of the item also. You have around 200 items in system, so we can cannot put if else condition in XML publisher rtf template to display item images based on Items.

For this scenario , you can put all the item images in your server and but image name should be your item name so that when your xml report will run then according to the items it will find item picture in server and prints that in output.

Note: This method only applies to Oracle E-Business Suite installations.
1. Insert a dummy image in your template.

How to display blob image in xml Publisher
How to display blob image in xml Publisher

2. In the Format Picture dialog box select the Web tab. Enter the following syntax in

the Alternative text region to reference the OA_MEDIA directory:
concat function to build the URL string. For example:
url:{concat(SERVER,’/’,IMAGE_DIR,’/’,IMAGE_FILE)}.

OR

Right Click on the Dummy Image an Select Edit Alt Picture.

How to display blob image in xml Publisher
How to display blob image in xml Publisher

Use the Concat Function url:{concat(SERVER,’/’,IMAGE_DIR,’/’,IMAGE_FILE)}.

In this case , we are using CF_ITEM is a dynamic variable to fetch the Items name from the Data Base.

How to display blob image in xml Publisher
How to display blob image in xml Publisher


How to display blob image in xml Publisher
How to display blob image in xml Publisher

0 comments:

Post a Comment

Contact us for any Collaboration, Project Support & On Job Support Work

Name

Email *

Message *