Display a Linked Picture from a Parameterized Active Server Page - Greg Collins
in

InfoPath Dev

This Blog

Syndication

Greg Collins

Display a Linked Picture from a Parameterized Active Server Page

You might need to display a custom picture in your form based on field values. You can do this using an Active Serve Page that takes parameters. Your Active Serve Page might return a barcode, a map, a photograph, or any other kind of picture. Your form will use the Linked Picture control.

In this task we will show how to set up the linked picture binding to retrieve a picture from an Active Server Page using two field values from the main data source. We assume that you already have an existing Active Server Page capable of accepting parameters and returning a picture. Let's start by designing a new blank form.

Add the parameter fields to your main data source:

  1. Open the Data Source task pane.
  2. Add two Text Fields named Param1 and Param2.

Create a custom linked picture binding:

  1. Open the Controls task pane.
  2. Insert a picture into the view.
  3. In the Insert Picture Control dialog box, select As A Link, and then click OK.
  4. Double-click the picture control in the view.
  5. In the Picture Properties dialog box, replace the XPath with the following:

concat("http://server/picture.asp?param1=", my:Param1, "&param2=", my:Param2)

Make the appropriate adjustments to the URL to match your server, Active Serve Page and parameter names.

  1. Clear the Allow The User To Browse For New Pictures check box, and then click OK.

Try it:

Preview your form. Assuming your URL is valid and the ASP page is working correctly, when you enter valid values into the Param1 and Param2 fields, you will see your picture correctly updated.

©2004 Greg Collins. All rights reserved. Licensed to Autonomy Systems, LLC for display on InfoPathDev.com.

Comments

 

techforever said:

hi. how about if youre using a web based form to display the picture from a parameterized asp?

March 1, 2009 11:55 PM
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.