Friday, July 3, 2015

Inserting images in BIP templates for HTML output

 

Just documenting a BIP trick to insert images when the output will be in HTML. Time to time, report designers have to embed static images like logos or emblems on reports which have to be rendered along with the final output. Simply inserting the image into the RTF template will work fine if the output is in RTF or PDF format, but the images will be blank if the output is in HTML. This is , of course, because HTML does not embed the image, it just adds the the url reference to the image. Here is how to place an image in the RTF template so that it renders properly no matter what the output format.

cleartext.blogspot.com

First of all, you will have to place the image to be rendered in a public server somewhere, this can be anywhere on the internet which can be accessed via a url. Do not place this image on any server behind corporate firewalls,or it won't be rendered.

cleartext.blogspot.com

 

1: First, enable 'Developer Mode' in your Word. For this, go to File->Options->Cutomize Ribbon, and check the box next to 'Developer' in 'Main Tabs':

tmpB0AE

2: Now under the new 'Developer' tab, click on 'Design Mode'

clip_image001

3: Now, from under "Legacy forms", choose the image holder: cleartext.blogspot.com

clip_image001[5]

4: This will put a nice grey square in your template. Right click that,  choose 'Format Control' , and go to 'Alt Text'

tmp46C

5: Under the alternative text, insert the url to the final image to be rendered.  cleartext.blogspot.com

tmp9EE7

6: Thats it ! Now when you generate the output of this template, the image will be rendered properly in any output format, including HTML.

7: Bonus ! You can even add a unique URL to the image, so that when it it clicked, the user it re-directed to another website. For this, right click the image (or grey square) and choose hyperlink. Insert the url in the hyperlink box. The re-direction also works regardless of output type.

cleartext.blogspot.com

 

Cheers !

No comments:

Post a Comment