Getting Started with Microsoft InfoPath 2003
by Wei-Meng Lee, author of Windows XP UnwiredOne of the things I have always been averse to doing is filling out forms. This is especially troublesome if you work in a big company where you have to fill out multiple forms just to purchase an item. Most of you have had this similar experience: first you have to fill out a physical form to get your superior's approval for an item, then you must fill out an online requisition order to procure the item. Wouldn't it be nice if you could simply fill out one form that would allow all other applications to use the data collected on that form?
Microsoft has realized this problem and presents its solution in InfoPath 2003, an application that comes with Microsoft Office 2003 Professional Edition. InfoPath 2003 allows you to build forms for data collection and then save them in the XML document format. With XML, different applications can then reuse the information without the need for users to enter the same data multiple times.
In this article, I will introduce you to the power of InfoPath 2003 and show you how you can build a simple form to start collecting data.
Examining the XML Schema
InfoPath 2003 provides several ways for you to define the types of data you want to collect:
- XML Schema or XML document
- Database
- Web services
For this article, I will illustrate the first method--using an XML Schema. Suppose I have the following XSD document:
<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="Magazines" type="MagazineType"/>
<xsd:complexType name="MagazineType">
<xsd:sequence>
<xsd:element name="Magazine"
type="MagazineDetails"
minOccurs="0"
maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="MagazineDetails">
<xsd:sequence>
<xsd:element name="Title" type="xsd:string"/>
<xsd:element name="Publisher" type="xsd:string"/>
<xsd:element name="Comments" type="xsd:string"
minOccurs="0" maxOccurs="1"/>
</xsd:sequence>
<xsd:attribute name="Price" type="xsd:float"/>
</xsd:complexType>
</xsd:schema>
This XSD defines the structure of the information that I want to collect. In particular, I want to capture magazine information such as title, price, and publisher.
|
Related Reading Windows XP Unwired |
Building and Designing the Form
Using the XSD document, I want to build a form to collect information about the magazines that I have. So, let's launch InfoPath 2003 and go to File -> Design a Form.
You will see the Task Pane displayed on the right side of the window (see Figure 1):

Figure 1. Designing a new form
You can create a new form from a Data source (such as from a schema, a database, or a Web service), and then either start a blank form, or extend a sample form (provided by InfoPath 2003). For this example, I want to create a new form from an XSD document, and so I select "New From Data Source".
In the Data Source Setup Wizard (see Figure 2), select the type of data source to which you are connecting. In my case, select XML Schema or XML data file. Click Next.

Figure 2. Selecting the data source
Browse for the XML Schema and click Finish.
In the Task Pane, you will be able to see the element and attribute names as defined in the XSD (see Figure 3).

Figure 3. Viewing the data source
To build the form for the user to fill in, click on Layout in the Task Pane and use the required layout controls.
First, let's add a "Table with Title" to our form (see Figure 4). I have also changed the shading and font color.
![]()
Figure 4. Adding a Table with Title to our form (You can click on the screenshot to open a full-size view.)
Then, click on Data Source in the Task Pane, and drag the Magazine folder into the Table (see Figure 5):
![]()
Figure 5. Adding a table to our form (You can click on the screenshot to open a full-size view.)
You will be prompted to select the kind of section you want to add. Select Repeating Table (see Figure 6):
Figure 6. Choosing the Repeating Table
You should see the layout, as shown in Figure 7:
Figure 7. The newly created form layout
You are now ready to publish the form.
Publishing the Form
To publish the form, go to File - > Publish.
The Publishing Wizard provides three ways to publish your form (see Figure 8):
Figure 8. Choosing the way to publish a form
In my case, I chose to publish it to a shared folder, c:\Magazine.xsn.
To use the form, the user simply needs to double-click on the .xsn file (in Windows Explorer) and InfoPath will launch the form. (In an Intranet setting, it would be useful to publish the form to a Web server and point the user to the URL to download the form.)
You can enter multiple magazine information by clicking on the arrow and selecting Insert Magazine above/below to add new records (see Figure 9):
Figure 9. Filling in the form
Once you've completed entering the data, you need to save the form. To save it, simply click on File - > Save. All the magazine information will be saved in an XML document.
You can use NotePad to view the XML document you've generated:
<?xml version="1.0" encoding="UTF-8"?>
<?mso-infoPathSolution solutionVersion="1.0.0.10"
productVersion="11.0.5531" PIVersion="1.0.0.0"
href="file:///C:\Magazine.xsn" language="en-us" ?>
<?mso-application progid="InfoPath.Document"?>
<Magazines>
<Magazine Price="5.95">
<Title>SQL Server magazine</Title>
<Publisher>Penton</Publisher>
<Comments></Comments>
</Magazine>
<Magazine Price="4.95">
<Title>Web Techniques</Title>
<Publisher>CMP</Publisher>
<Comments>Renamed to ...</Comments>
</Magazine>
<Magazine Price="5.00">
<Title>Wireless and B</Title>
<Publisher>Sys-Con Media</Publisher>
<Comments></Comments>
</Magazine>
</Magazines>
Note that the XML document has two additional PIs (Processing Instructions) to invoke InfoPath 2003 when it is double clicked.
Since the information is now saved as XML, other applications can then easily use the information in the document.
Printing the Form
Besides filling in the form and saving the data as XML, InfoPath 2003 also allows you to print the form. This is especially useful when you need to generate a hard copy of your form to sign. You can preview the form by going to File - > Print Preview (see Figure 10):
![]()
Figure 10. Viewing the Print Preview (You can click on the screen shot to open a full-size view.)
Summary
InfoPath 2003 is a useful tool for collecting data, especially in organizations where there is a need to integrate several applications together. In this article, you have seen how InfoPath 2003 works and how to build a very simple form to collect data and save it as an XML document. If you have any questions, feel free to use the TalkBack section below to send them to me.
Wei-Meng Lee (Microsoft MVP) http://weimenglee.blogspot.com is a technologist and founder of Developer Learning Solutions http://www.developerlearningsolutions.com, a technology company specializing in hands-on training on the latest Microsoft technologies.
Return to the Web Development DevCenter.
You must be logged in to the O'Reilly Network to post a talkback.
Showing messages 1 through 17 of 17.
-
How can I learn about creating web services for a database that infopath doesn't natively support?
2009-03-02 09:12:12 larryvirden [Reply | View]
-
I WANT TO DESIGN A FORM FOR USERS AT VARIOUS PLACES ACROSS MY INTRANET
2008-02-26 06:24:55 CHITTA [Reply | View]
Hi, i want to design a form for users at about 10000 places over which my intranet works. When they fill out the forms regularly, and sometimes even more often than regularly, how can I analyse the data I get at the central point in my server?
-
printing problems
2007-06-18 10:44:32 ssierschula [Reply | View]
For some reason I can't print the forms to any of the shared printers in the office. Some co-workers are able to save forms in Microsoft Image Writer, then print. Others can only print to certain printers. Nothing is working for me unfortuantely. Otherwise I am able to print everything else on my computer - word docs, excel, etc. Any ideas would be greatly appreciated.
-
printing problems
2007-06-18 10:44:02 ssierschula [Reply | View]
For some reason I can't print the forms to any of the shared printers in the office. Some co-workers are able to save forms in Microsoft Image Writer, then print. Others can only print to certain printers. Nothing is working for me unfortuantely. Otherwise I am able to print everything else on my computer - word docs, excel, etc. Any ideas would be greatly appreciated.
-
printing problems
2007-06-18 10:43:57 ssierschula [Reply | View]
For some reason I can't print the forms to any of the shared printers in the office. Some co-workers are able to save forms in Microsoft Image Writer, then print. Others can only print to certain printers. Nothing is working for me unfortuantely. Otherwise I am able to print everything else on my computer - word docs, excel, etc. Any ideas would be greatly appreciated.
-
InfoPath
2005-02-10 15:57:21 Medde [Reply | View]
I have a couple of questions for you:
Is it possible to create forms that populate a Access Database and then pull that information out of the database forms for a whole new set of forms.
Also I have a program that I don't control and want to publish information that it generates on the WEB. Can I use Infopath to create forms with drop downs that I could select the findings of the other program and then publish that to a webpage with the click of a button.
Thanks, Michael
-
InfoPath 2003
2004-02-25 03:45:37 phrenetic [Reply | View]
The article states that InfoPath 2003 comes as part of Office 2003 Professional Edition. I don't think this is correct - can anyone confirm the true position? -
InfoPath 2003
2004-05-12 14:39:34 bazango [Reply | View]
I am pretty sure it came with later editions of 2003. My machine was built recently, and it was there in the office suite. Some co-workers, who's machines were built earlier, have 2003, but no infopath. I found out when they tried to use my forms :-o -
InfoPath 2003
2004-07-28 11:14:52 AV8Orr [Reply | View]
Infopath only comes bundled with Office 2003 "Enterprise Edition" (commonly purchased by large businesses). It is not included with Office 2003 purchased as a standalone copy. This is an unfortunate marketing gaff on microsoft's part if you ask me.
-
Microsoft InfoPath
2004-01-07 06:36:52 rhinoguy23 [Reply | View]
Thank you for the article on Microsoft's InfoPath. The article definitely cleared up a few of the questions I have regarding this product. However, I'm still have questions about the functionality of InfoPath.
Can the forms be edited and reused? If so, how? Can the forms be emailed? Does this product work best on an intranet web server, or on Microsoft's SharePoint? If I make a form, and want other people to use it (edit it), what do the other people need to edit the form? I'm thinking in a help desk scenario where people request software or hardware help. Could this product be used in such a scenario?
Thanks. -
Microsoft InfoPath
2004-02-04 06:57:29 travisowens [Reply | View]
The end user MUST have INfopath 2003 installed in order to use yoru form. The form cannot be exported as a HTML form or anything else.
Forms cannot be re-used and if you make a change to yoru database structure, you MUST rebuild the form from scratch (sucks eh?).
Infopath does let you make simply data entry apps in a pure GUI fashion in a mere hour, but as you can see it has some severe shortcomings.
Hopefully MS can fill the database changes problem in the next version (almost makes you wonder if they did that on purpose to give us a reason to buy Office 2004). -
Microsoft InfoPath
2005-09-03 12:52:49 datastreamcowboy [Reply | View]
There are more and more 3rd party utilities for Infopath. I have seen several viewers and converters availible... ranging in price from free to quite pricy. -
Microsoft InfoPath
2004-03-18 02:02:28 t-fleischmann [Reply | View]
It is possible to extract the complete InfoPath-file to various human-readable files (xml/xsl/xsd/js...) and to change these files.
So it is probably possible to change the form when the database changed. But this will of course work only with small changes. -
Microsoft InfoPath
2004-09-09 06:10:19 Angeldeelight [Reply | View]
How can I manage extracting InfoPath files to "human-readable" files such as .xsl or .xml? I've been trying desperately... -
Microsoft InfoPath
2004-05-12 14:35:40 bazango [Reply | View]
I'm struggling with InfoPath. It seems that everything I want to do is exactly what it won't do. I am trying to create a form from a database with repeating sections. It won't let me bind to a field that is not a repeating field, but it won't let me change the properties of my fields so I can make them repeating fields. ARgnf! Whatheheck determines field properties? It never asked me!
-
Microsoft InfoPath
2005-05-25 06:15:04 dracostheblack [Reply | View]
In the data source view grab the object you want as a repeating section with a right click and drag it to the form. It will give options of what type of object you would like to make that datasource.
Also I had a question how would one go about making a webservice that once you sumbit the form it consumes the forms data and saves so later you can make another form to access it? Like you have a timesheet that everyone fills out and then sumbits, after that the boss uses his mastersheet form to view all of the submissions.







In the articles that I read, the suggestion is always to write your infopath to interact with a web service.
I've not yet found an article or book that describes how best to create a web service that can then be used with infopath to perform this type of functionality.
I was wondering if there were suggestions on best places to read about ways to develop such a thing.