The following is a description of how to display a product image in a BI Publisher Report for Siebel 8.1.1.
Before Siebel 8.1 was released, BI Publisher was not the official reporting tool, but in a Siebel 8.0 project we used it anyway (at least for a POC). One of the report requirements was to display attached images (the signature of a customer that is) in the report and we were able to do that in stunningly short time.
Before we start, let me add that this post is not intended to show you how to create a new BI Publisher report in Siebel 8.1.1 as this procedure is part of the documentation and there are courses available on this topic. I also assume that you are familiar with Siebel Integration Objects and the BI Publisher Desktop.
Let's start with the Integration Object. When generating the IO you have to include the business component that carries the image information. In our case we include the BC that implements the product image.

To use the IO with BI Publisher Reports in Siebel you must use a name that starts with "BIP" (no kiddin').
Create and compile the IO as usual. In Siebel 8.1.1 you can also deploy the IO to the database without compiling. A quick test with EAI Siebel Adapter and the Business Service Simulator shows that the IO works properly even when not compiled. Nicely done.
Question: How does EAI Siebel Adapter handle image and attachment data during query operations?
Answer: They are included in the output property set in base64 encoding. The resulting XML will carry the encoded string "inline".
Let's see how we can later decode that string.
Next you register the IO in the BIP Administration Screen and generate the sample data. Make sure that you have some data available, as the sample data generation pulls the first 10 records of the respective primary BC (based on my observations, maybe ordered by ROW_ID, there is no documentation on that). In our example, I created a simple product, uploaded a jpg image file via the Administration - Document screen and associated it with the product in the More Info view.

Create the report template using BI Publisher Desktop as usual. In our example we use the popular plugin for MS Word. We create a simple report with a grouped table.
But how to decode the base64 string for the product image?
Here's the trick: Include the field that carries the base64 encoded string. In our case it's named imageFileBuffer. When you double-click a field, the BI Publisher property window is displayed. Change the code to the following:

<xsl:value-of select="imageFileBuffer"/></fo:instream-foreign-object>
This code which uses the fo:instream-foreign-object object allows us to decode a base64 string back to the jpg image it previously was.
You might have to tweak the path to the base64 encoded string relative to the current object. Example:
<xsl:value-of select=".//AttachmentId" />
This would take the AttachmentId element from two levels below the current.
Did I mention that this example works with jpg images? It's supposed to work with other image formats (gif, png) as well but jpg seems the most reliable.
A preview in BI Publisher Desktop should already show the desired outcome.
Now we can upload the rtf template in the BIP Administration screen, generate the XLIFF file and associate our report with a Siebel view.
In the view, we can do a query for the desired products, click the Report button, select the newly created report and marvel at the magic of base64.

have a nice day
A preview in BI Publisher Desktop should already show the desired outcome.
Now we can upload the rtf template in the BIP Administration screen, generate the XLIFF file and associate our report with a Siebel view.
In the view, we can do a query for the desired products, click the Report button, select the newly created report and marvel at the magic of base64.

![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_e.png?x-id=3d20fca1-a6d3-4c78-b44b-6071a2659529)


![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_e.png?x-id=5c0e371e-ddd2-4859-82e2-58e50102be88)









![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_e.png?x-id=5f082b5c-9fa9-459b-ac2e-321f86ffa868)



![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_e.png?x-id=1d8dc104-b961-4efc-a535-a5d787ee35c2)



![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_e.png?x-id=b7cdea0b-dba9-4161-956d-9f6815be2959)





![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_e.png?x-id=b2939cf0-e46e-4a0b-952c-2d1ee1f4249c)

