Displaying images in InfoPath 2007 browser forms served through Forms Services in SharePoint

Learn about workarounds that are available to display images in InfoPath forms that are served via InfoPath Forms Services in SharePoint.

ADVERTISEMENTS

Problem

The Picture control is not available in the list of controls when you create a browser-compatible form template (also see InfoPath 2007 features that are unavailable in InfoPath Forms Services), so you cannot use a Picture control to display images in an InfoPath form that is displayed in a browser via InfoPath Forms Services in SharePoint, but you still want to display images in an InfoPath browser form.

Solution

Use an Attachment control, a Rich Text Box control, or embed your form in a page that runs within SharePoint.

Discussion

  1. Use an Attachment control if you have to store images within a form. However, this will not actually display the image on the form, but will only store the Base64 encoded string of the image in the form.
  2. Create a custom web page to display your form in, use ASP.NET controls to display images on the web page, and set up communication between the form and the web page to store the images within the form. In this case, the web page will display the images and *not* the InfoPath form. For more information on how to create a custom web page to display an InfoPath form, see Hosting the InfoPath 2007 Form Editing Environment in a Custom Web Form.
  3. Use a Rich Text Box control to display an image. While a Rich Text Box control cannot display embedded images when you use the control in browser forms served through InfoPath Forms Services in SharePoint, it can display linked images. The image must be published on a web server and accessible through an URL. You can then use an IMG element to add a link to the image to the Rich Text Box field. This will display the image in the Rich Text Box control in the browser form. For more information on how to do this, see How to display images in a repeating table in a browser form using a Rich Text Box control.

So the workarounds to displaying images on InfoPath browser forms are:

  1. If you only need to display images, you can go with option 3.
  2. If you need to display as well as store images, you can choose option 2.
  3. If you only need to store images, option 1 would suffice.

 


Related InfoPath Articles:

 

Copyright: This article may not be used on web sites (whether personal or otherwise), copied, disseminated, altered, printed, published, broadcasted, or reproduced in any way without an expressed written consent. The techniques demonstrated in this article may be used within any Microsoft InfoPath project. This article is provided without any warranties. Copyright for this article is non-transferrable and remains with the author.

InfoPath 2013 Cookbook: 121 Codeless Recipes for Beginners

InfoPath 2013 Cookbook 2: 121 Codeless Recipes for SharePoint 2013

InfoPath 2010 Cookbook: 101 Codeless Recipes for Beginners

InfoPath 2010 Cookbook 2: 101 Codeless Recipes for SharePoint 2010

InfoPath 2010 Cookbook 3: 101 Code Recipes for C# Developers

InfoPath 2010 Cookbook 4: 101 Code Recipes for VB Developers

InfoPath 2010 Cookbook 5: Integrating InfoPath with Excel and Excel Services