Export (0) Print
Expand All
6 out of 10 rated this helpful - Rate this topic

Integrating InfoPath 2010 with the SharePoint 2010 Data Connection Library

Office 2010

Summary:  Learn how to use Universal Data Connection (UDC) files in a Data Connection Library (DCL) to provide data connection settings to Microsoft InfoPath 2010 form templates for use in both client and server forms.

Applies to:  Microsoft InfoPath 2010, Microsoft SharePoint Server 2010
Published:  November 2010

Contents

Lab Objectives

In this lab, you will learn how to:

  • Create a data connection library for Microsoft SharePoint Server 2010.

  • Create a Universal Data Connection (UDC) file to specify a SharePoint list data connection.

  • Use InfoPath 2010 to design a form that uses the settings contained in a data connection library.

  • Set up a drop-down list to show only unique values from a data connection.

Lab Setup and Requirements

To complete this lab, you must have the following:

  • InfoPath 2010 installed on a client computer.

  • Access to a SharePoint Server 2010 as a farm administrator or site collection administrator.

  • InfoPath Forms Services running on an installation of SharePoint Server 2010.

Alternatively, you may install both InfoPath 2010 and SharePoint Server 2010 on the same computer.

Scenario

Jane at Contoso Pharmaceuticals wants to create a simple form to enable the sales team to submit feedback about the sales events announcements. These announcements are located on the team SharePoint Server site.

Exercises

The following exercises describe how to create and test a simple form. First, you will create the data connection library. Then, you create the connection settings file. Finally, you create the form and test the connection.

Creating a Data Connection Library

The first step is to create a data connection library in a site collection. The data connection library will provide a location to put the shared data connection settings file.

To create a data connection library

  1. Browse to an SharePoint Server 2010 site on which you have at least Design permissions. If you are on the root site, create a new site before you continue with the next step.

  2. On the Site Actions menu, click More Options.

  3. On the Create page, click Library under Filter By, and then click Data Connection Library.

  4. Type DCLLab for the library name, and then click Create.

  5. Copy the URL of the new data connection library.

Creating a Connection Settings File

After you have created the data connection library, you can then create a new Universal Data Connection (UDC) file. Later on, you will create a form that contains an announcement list; InfoPath will use the UDC file to locate data to fill that list.

To create a new data connection file to point to the Announcements list on your site in InfoPath

  1. Open InfoPath Designer 2010, click Blank Form, and then click Design Form.

  2. On the Data tab, click Data Connections, and then click Add.

  3. In the Data Connection Wizard, click Create a new connection to, click Receive data, and then click Next.

  4. Click SharePoint library or list, and then click Next.

  5. Enter the URL of the SharePoint site, and then click Next.

  6. In the Select list or library list, select Announcements, and then click Next.

  7. On the next two pages, click Next.

  8. On the last page of the wizard, click Finish to return to the Data Connections dialog box.

  9. In the Data Connections dialog box, click Convert to Connection File.

  10. In the Convert Data Connection dialog box, enter the URL of the data connection library that you previously copied (delete "Forms/AllItems.aspx" and anything following it from the URL), enter the name DCLLab for the data connection file at the end of the URL, and then click OK.

    InfoPath Designer will take several moments to convert and save the data connection file to the library.

To confirm that InfoPath Designer successfully converted the data connection

  1. Select the name of the converted data connection in the Data Connections dialog box, and examine the Details section. When you are finished, click Close.

  2. Close InfoPath Designer 2010 without saving the changes to the form.

    Ordinarily, you would continue designing the form after you define the data connection. For this demonstration however, you start designing the form from scratch in the next procedure.

  3. Browse to the SharePoint data connection library, click the drop-down next to the name of the data connection (DCLLab), click Approve/Reject, click Approved, and then click OK.

  4. Browse to the Announcements list, and then click Add new announcement.

  5. Enter multiple announcements for testing; be sure to include at least one duplicate announcement.

Creating a Form to Test the Connection

In the previous step, you created a Universal Data Connection (UDC) file that specified where you can get data for an announcement list. In the following step, you will create an InfoPath form that references that connection information. InfoPath enables you to create any number of forms that reference the UDC file; for the purpose of this lab however, one will suffice. Be aware that updating the UDC file to point to a different location will automatically update all of the forms that reference the UDC file.

The following steps show how to create a form that uses the connection information in the UDC file.

To add a reference to the UDC file to a new form template

  1. Start InfoPath Designer 2010, click Blank Form, and then click Design Form.

  2. On the Data tab, click Data Connections, and then in the Data Connections dialog box, click Add.

  3. On the first page of the Data Connection Wizard, select Search for connections on a Microsoft Office SharePoint Server, and then click Next.

  4. Click Manage Sites, and then in the Manage Sites dialog box, click Add.

  5. In the Site Details dialog box, in the first field, type the path of the site that contains your data connection library (for example, http://MyServer/MyTeamSite).

  6. (Optional) In the second field, type a display name to identify this site.

  7. Click OK, and then click Close.

  8. In the Site list, select the site that you defined.

  9. Expand the entry for your data connection library, select the UDC file that you uploaded, and then click Next.

  10. Choose the following columns to include in the list, and then click Next:

    • Title

    • Modified

  11. Select the Store a copy of the data in the form template check box to cache a copy of the current data in the form for an offline user, and then click Next.

    noteNote:

    Announcements data is unlikely to change frequently. Therefore, caching the data offline ensures that the user always has the data available, without significant risk of the data being out of date.

  12. Click Finish, and then click Close.

    In the next procedure, you will add some text, a Drop-Down List Box, and two Option Button controls to the form so that it resembles the following form template shown in Figure 1.

    Figure 1. Creating a simple form to test the data connection

    Form to test the data connection

To add controls that display data from the UDC file to the form

  1. Double-click the drop-down list, and then on the Control Tools Properties tab, click Edit Choices.

  2. Under the List box choices, select Get choices from an external data source.

  3. Select the Announcements list data connection that you added in the previous exercise from the Data source list.

  4. Click the button next to the Value field, and then select the ID field.

  5. Click the button next to the Display name field, and then select the Title field.

  6. Select the Show only entries with unique display names check box, and then click OK.

  7. Save the form.

After you have finished designing the form, test your solution.

To test the form

  1. On the Home tab, click Preview Form.

  2. Open the drop-down list; observe that InfoPath populated the list from the Announcements list.

    noteNote:

    InfoPath has filtered the entries so that only unique entries appear in the list.

  3. Close the preview window and save the form.

Conclusion

In these exercises, you learned how to create a data connection library on SharePoint Server 2010. You also learned how to create a Universal Data Connection file in InfoPath Designer 2010 to define a SharePoint List connection. In addition, you learned how to design a form that takes data connection settings from the UDC file. Finally, you learned how to set a drop-down list to show only unique values from a data connection.

Additional Resources

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.