Windows IT Pro is the authoritative and independent resource for windows nt, windows 2000, windows 2003, windows xp. Features a collection of resources and magazines for windows IT professionals.
  
  
  Advanced Search 


April 2007

SharePoint and InfoPath: A Powerful Duo

Easily publish XML-based forms to your SharePoint site
RSS
Subscribe to Windows IT Pro | See More Collaboration Articles Here | Reprints | Or get the Monthly Online Pass—only $5.95 a month!

Microsoft Windows SharePoint Services 2.0 is well known for its document-sharing and collaboration capabilities. IT professionals have been using it for several years now as both a document repository and an area for team workspaces. With document libraries, task lists, discussion threads, and other features, SharePoint Services 2.0 offers users the ability to access and distribute content quickly.

One lesser-known feature of SharePoint Services 2.0 is the form library, which allows for the management of XMLbased form files. For the IT professional, the advantage these form files have over other types of files (for example, Microsoft Office Word 2003 documents) is obvious: Form files are structured and consistent. Because the XML standard focuses mainly on content, the form library files aren't riddled with varying degrees of formatting and thus are easier to process than Word documents. Of course, creating these form files requires an XML editor such as Microsoft Office InfoPath 2003 Service Pack 2 (SP2). Fortunately, there's strong integration between SharePoint Services 2.0 and InfoPath 2003 SP2.

After I give you a brief overview of InfoPath and its form designer, I'll walk you through the various options and processes involved in deploying an InfoPath form template to a SharePoint site. I'll also review some of the form library modifications that you'll need to make after you publish the form template.

About InfoPath
In a nutshell, InfoPath is an application that lets you design and fill out electronic forms. The InfoPath form designer uses an XML schema, controls bound to schema elements, data connections, data validation, and conditional formatting within a template. End users can enter data in the fields as needed. Form data is stored as XML, which is then either submitted to a specified location such as a SharePoint form library or saved to the user's local drive.

When you create an InfoPath form, you can build it from scratch or use one of the built-in sample templates that help you implement scenarios such as status reporting, issue tracking, and purchasing. For this article, I'll be using the sample Status Report template to design the form, but you can use the techniques here to design forms based on any of the other sample templates.

When you look at the sample Status Report form, which Figure 1 shows, you can see some of the controls that are available, including

  • a date picker control and text box controls at the top of the form
  • rich text box controls in the Summary and Notes sections
  • bulleted list controls in the Last Period, This Period, and Issues sections.

Each control is bound to an element in the form's data source. This data source is mapped to an XML schema, which identifies the structure of the form file and the data types for the individual elements. When users enter data in a form, that data conforms to the rules specified in the associated XML schema.

Data Validation
You can add rules to controls to validate data that users enter. For example, if you want to flag a time report entry that exceeds 40 hours for time spent, you can add a validation rule for the spent element. At runtime, if the user enters data that violates the rule, a red border would appear around the text box control with a screen tip or message indicating the nature of the validation problem. To create this validation rule, perform these steps:

  1. In the Time Report repeating table, double-click the text box bound to the spent element.
  2. In the Text Box Properties dialog box, click Data Validation.
  3. In the Data Validation text box, click Add.
  4. In the middle box at the top of the dialog box, select is greater than from the drop-down list, as Figure 2 shows.
  5. In the third box, select Type a number from the drop-down list and enter 40 in the box.
  6. In the ScreenTip box, type a message or screen tip explaining the problem.
  7. Click OK until all dialog boxes have been closed.

Conditional Formatting
Another option available when you design a form is conditional formatting, which you can use to enable or disable controls in the form view. For example, if you want to add logic that disables the Department text box when data has already been provided in the E-mail Address text box, you can add a conditional formatting rule to the Department text box control. The following example shows how to create this conditional formatting rule:

  1. Double-click the text box bound to the department element.
  2. In the Text Box Properties dialog box, click the Display tab.
  3. Click Conditional Formatting.
  4. In the Conditional Formatting dialog box, click Add.
  5. In the first box at the top of the Conditional Format screen, select emailAddressPrimary from the drop-down list, as Figure 3 shows.
  6. In the second field, change the value to is not blank.
  7. Select the Read-only check box
  8. Click OK until all dialog boxes have been closed.

SharePoint Data Connection
When designing form templates that are to be used with SharePoint Services, you can create data connections that allow users to submit form files to a SharePoint form library. InfoPath 2003 SP2 has a built-in SharePoint submit adapter that enables form designers to specify a SharePoint form library URL. InfoPath also lets you create the library that will host the form template. I'll walk you through the form library-creation process, but first let's look at the process of creating a SharePoint data connection for submitting forms.

   Previous  [1]  2  3  Next 


Reader Comments

You must log on before posting a comment.

If you don't have a username & password, please register now.




Top Viewed ArticlesView all articles
Command Prompt Tricks

One reader shares his tip for setting up the command prompt to reflect a remote path. ...

PsExec

This freeware utility lets you execute processes on a remote system and redirect output to the local system. ...

Autoruns

Tired of dealing with autostart programs? Use this free tool to find them and deal with them. ...


Windows OSs Whitepapers Why SaaS is the Right Solution for Log Management

Related Events Microsoft BI Unleashed | Online Conference

You've Deployed SharePoint ...Now What? :: FREE Online Conference!

Check out our list of Free Email Newsletters!

Windows OSs eBooks Understanding and Leveraging Code Signing Technologies

A Guide to Windows Certification and Public Keys

SQL Server Administration for Oracle DBAs

Related Windows OSs Resources Become a VIP member of the Windows IT Pro community!
Get it all with the VIP CD and VIP access. A $500+ value for only $279!

Subscribe to Windows IT Pro!
Solve your toughest technical problems with our experts and access 10,000 + articles online. 30% off

Monthly Online Pass - Only $5.95!
Get instant access to 10,000+ articles from Windows IT Pro Magazine!

TechNet Virtual Labs
Evaluate and test Microsoft's newest products.


Windows IT Pro Home Register FAQ for Windows WinInfo News
Europe Edition About Us Contact Us/Customer Service Media Kit Affiliates / Licensing  
SQL Server Magazine Office & SharePoint Pro Windows Dev Pro IT Job Hound ITTV
IT Library Technology Resource Directory Connected Home Windows Excavator Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 Copyright © 2008 Penton Media, Inc., All rights reserved. Terms and Use | Privacy Statement | Reprints and Licensing