Thursday May 03, 2012

Proxy Images in EBS

Gareth Roberts, founder of Virtuate, a consulting outfit based in New Zealand, came up with a doh! moment for me this week. He has been working with Publisher and trying to get images into his reports that are sitting behind a proxy server. This is all inside E Business Suite so no means to use the JVM proxy settings when the concurrent manager starts up. The support folks found the solution that I had completely forgotten about ... I have been away from EBS too long :(

When the concurrent manager (CM) starts a java based job (concurrent program) such as a Publisher one. It fires up a new JVM instance for it. In their wisdom the CM development folks left an 'options' field on the concurrent program definition where you can add JVM start up parameters.

So to allow Publisher to reach the proxied images adding the following to the options field:

-Dhttp.proxyHost=<proxyhost> -Dhttp.proxyPort=<proxyport>

did the trick. Why a Doh! moment? Because we also used the same field when we knew a report was going to be BIG and wanted to increase the memory heap available to that particular report at runtime i.e. -Xmx, -Xmn, etc. You can catch Gareth over on his blog waxing lyrical about all things EBS.

Pieter from support pointed out that if the application requires a proxy server then it can be done at a more global level, that is via the context file using these CP context variables:


[vispb12@pbreugel4 ~]$ grep s_afjsmarg $CONTEXT_FILE
            <AFJSMARG oa_var="s_afjsmarg" osd="Linux">-server -Xmx384m -XX:NewRatio=2 -XX:+UseSerialGC -Doracle.apps.fnd.common.Pool.leak.mode=stderr:off -verbose:gc</AFJSMARG>
[vispb12@pbreugel4 ~]$ grep s_afjcparg $CONTEXT_FILE
            <AFJCPARG oa_var="s_afjcparg" osd="Linux">-client</AFJCPARG>

More on that approach here - 

Friday Aug 14, 2009

Bloody Blue Borders

[Read More]

Thursday May 04, 2006

Inserting BLOBs into your report


Good question on the forum asking how to insert a db stored blob image in the report output? It can be done relatively easily the first task is to get the blob out into your XML datasource.

Extract your BLOB

The XMLP data engine now(5.6.2) supports the extraction of blob images directly into the XML. Its pulled out and stored in a base64 format there is no limit on the size of the BLOB ie 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.

Reference your BLOB

In the template you now need to reference the image data. We can use an XSLFO expression to reference the image:

<fo:instream-foreign-object content-type="image/jpg">
 <xsl:value-of select="IMAGE_ELEMENT"/>

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 runtime the image is brought into the output, et voila!

Please note: In this release the BLOB support is limited to Oracle databases.


Tuesday May 02, 2006

Dynamic Images

Made it back from Nashville with a pile of requests for blog entries, I'll try and cover them over the next few weeks ... top of the list of requests was how to handle dynamic images in a layout template. There are several ways to tackle this depending on where your images are going to be at runtime. The scenario is, that I have three organizations in my company and they each have their own logo; at runtime, based on the organization I am generating a report for the output should show their logo. Lets assume we have the following XML data for all of these examples:

  <VENDOR_NAME>Nuts and Bolts Limited</VENDOR_NAME>
  <ADDRESS>1 El Camino Real, Redwood City, CA 94065</ADDRESS>

So our XML references an image directory(IMG_DIR) on our server(IMG_SERVER) and the full path to the image directory (IMG_DIR_PATH) on our server, then each invoice has the organization ID and the image name to be used. So we can tackle this one of three ways:
1. Embed the three logos into the template directly
2. Reference the images on the disk and use a dynamic image
3. Reference the images via a URL

Embedding in the template

This is the simplest method, if we have three images, one for each organization we can add them all to the template and wrap them in conditional statements to show/hide them. 


The simplest method is to use three 'if' statements, you could equally use a 'choose' statement to get the same effect. See DynamicImg1.rtf template here. If you have alot of images and/or need dynamic images in multiple templates; you could put a template function either else where in the template or ina completely separate template altogether and then call it from the main templates. See DynamicImg2.rtf for an example in the zip file

Using dynamic images

We can also just add a single dummy image to the template and at runtime point to the correct image file either on the file system or via a URL. We can build the file location of the image quite easily using the XSL concat() function.  Note at runtime the incoming image will be resized (if necessary) to fit the same dimensions as the dummy image.
So in the Web tab of the image properties we have:


File System: url:{concat(../IMG_DIR_PATH,'/',IMGFILE)} See DynamicImg3.rtf
URL: url:{concat(../IMG_SERVER,'/',../IMG_DIR,'/',IMGFILE)} See DynamicImg4.rtf

Notice we use '../' to get a level up from the G_VENDOR_NAME level for the root level values we need to construct the path or URL i.e. ../IMG_DIR_PATH.

If you are an E Business Suite user you can also make use of the OA_MEDIA directory. XML Publisher will resolve this value at runtime. So for an image in the OA_MEDIA directory you could use:


You can get all the examples and XML data here.
So thats dynamic images, of course you can use it for any image and you can build much more complex conditional formatting rules around the images. Have a good day ...


Follow bipublisher on Twitter Find Us on Facebook BI Publisher Youtube ChannelDiscussion Forum

Join our BI Publisher community to get the most and keep updated with the latest news, How-to, Solutions! Share your feedback and let us hear your voice @bipublisher on Twitter, on our official Facebook page, and Youtube!


« July 2016