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:
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.
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.