http://www.developer.com/net/net/article.php/3073041/InfoPath-2003.htm
InfoPath 2003 is one of the new additions to the Microsoft Office 2003 system that provides a dynamic forms based environment that allows business data to be collected and managed in XML without requiring end user knowledge of XML. Since the native format for data storage in InfoPath is XML, the information gathered using InfoPath forms can be very easily integrated with virtually any backend system that can understand and work with XML. InfoPath also allows the organizations to easily create rich and dynamic forms using the WYSIWYG interface that supports features such as offline editing, rich formatting, spell checking and so on. In this two-part article series, we will demonstrate the features of this new tool by looking at the InfoPath forms environment. We will also understand how to create dynamic data-bound InfoPath forms by leveraging external data sources such as SQL Server, and an ASP.NET XML Web Services. InfoPath is designed to solve a core problem in data collection and integration needs in the enterprise via XML. Despite XML's potential to enable application integration, its use typically requires a development background that involves typically XML and XSL. Because of this, it is primarily employed in back-office and data center applications. But now with InfoPath, you can bring the XML functionality to the desktop by allowing users to gather and manage business data in XML without requiring those users to know the language themselves. By providing native XML support, InfoPath allows customers to more readily reuse the information created through their business processes. For example, InfoPath can be used by the line of business (LOB) applications to bring the power of back-end systems and applications such as Customer Relationship Management (CRM), Enterprise Resource Planning (ERP), and Supply Chain Management (SCM), to every desktop. On a team level, InfoPath may be used to address such tasks as weekly status reports, sales call tracking and so on. Because of its seamless integration with other Office family products such as Excel, Outlook, and Windows SharePoint Services, you can readily share business data with your team members. InfoPath's form design interface includes familiar controls, such as check boxes, date pickers, and text boxes. You can create forms by dragging these elements into a document editor that provides WYSIWYG view of the form, and traditional text editing and layout facilities are available to arrange and format the form elements. You can get most of these functionalities without having to write a single line of code even though a script editor is available if you wish to add more complex functionality. When you are designing a form using InfoPath, you have two options. Data entered by users in InfoPath forms is stored in XML. InfoPath also provides out-of-the-box support for Web services protocols, including Simple Object Access Protocol (SOAP), Universal Description, Discovery, and Integration (UDDI), and Web Services Description Language (WSDL), making it an ideal client for Web services. You also have full control over the XML schemas used in this process, and you can bind form data controls to XML data elements by simply selecting them from a list. There are two main operations that you can do with InfoPath. For both of these tasks, you need InfoPath to be installed and available in the client machine. When you design a new form template, you can either start from scratch by selecting New Blank Form or base it on an existing data source by selecting New from Data Source. The task pane (available in the right hand side of a blank form) provides links to the various tasks you might want to perform while designing a new form. Specifically, you'll want to control the form layout, place controls on the form for capturing different types of information, define how those controls map to your underlying data source, define different data views of the form, publish it and so on. After selecting New Blank Form, InfoPath provides a blank design surface in which you can drag and drop controls onto. As you're designing a form, you can select Preview Form to see what it will look like when the user fills it out. As you design a form from scratch, InfoPath automatically builds an XML Schema definition behind the scenes to represent the information that will be captured by your form. If you fill out an InfoPath form and save it to disk, InfoPath will produce an XML document that conforms to the schema. InfoPath also provides an advanced feature that enables optional and repeating sections. Optional sections can be hidden and displayed on demand, making it possible to simplify forms and decrease clutter. Repeating sections let you repeat blocks of information that occur multiple times in a schema. InfoPath also enables you to bind repeating controls to external data sources for automatic population of the control. In this section, we will design a simple InfoPath form that can be used for entering the details of an employee. To create this form, let us follow the steps outlined below.
The first step in designing a data-bound InfoPath forms is to open InfoPath and click on the Design a Form option from the File menu. Now in the task pane, click on New from Data Source to specify the template and the data source. This results in the Data Source Wizard being displayed. As you can see from the above screen, InfoPath supports the following data sources: XML Schema or XML data file, Database (Microsoft SQL Server or Microsoft Access only), and Web Service. In this case, since we want to use SQL Server as the data source, select Database option and click Next. In the next screen, specify the database you want to use as the data source. Once you specify the database and the table information, you will get the screen in figure 6. In the subsequent dialog boxes, leave the default options to complete the wizard. Clicking Finish in the last wizard dialog generates two views. For the purposes of this article, let us add a very simple functionality that allows us to retrieve the details of a specific category based on the supplied category id. For this reason, remove the New Record button from the query view. Once you've designed a form template, you need to save and/or publish it. You should note that clicking the Save button simply saves the form template to a file. You can return to the form template at any time and continue working on it. The form template is a standalone file that contains all the information necessary for another user to fill it out. Before we discuss the steps involved in publishing an InfoPath form, let us consider the structure of an InfoPath solution file. InfoPath stores all template-related files in a compressed archive file called an InfoPath solution file that is saved with the file extension .xsn. The solution file contains manifest.xsf, which lists the other files the solution requires: .xml file (an empty form document), an .xsl file for producing each form view, and a .xsd file for the data source. The solution file also includes JScript or VBScript files, if form customization requires script and JScript is the default. Selecting Publish displays the Publishing Wizard, which allows you to distribute the finished form to a centralized location, accessible by other users. You can publish a finished form to a number of places: Once a form has been published, users can access the form directly from InfoPath (by selecting Fill Out a Form) or by simply browsing to the file in Windows Explorer or Microsoft Internet Explorer. When you browse to a form, InfoPath opens it in "fill out" mode and enables the user to enter data. While filling out the form, users also can save forms to the local drive and work on them in a disconnected manner and then submit data when reconnected. Users of a shared template can also store local XML snapshot copies of the forms they complete, send completed forms to others by e-mail, or export a read-only copy of the form as a single-file Web page in Microsoft MHT format. The e-mail version includes the form's XML file as an attachment. This feature enables recipients with InfoPath and network access to its template to edit the form. Users with client authentication certificates can apply digital signatures to the forms they complete, and others in the workflow chain can add their digital signatures to a form. In this article, we have understood the architecture and features of InfoPath 2003 that can go a long way in revolutionizing the process of capturing business data. We have also had a look at the rich WYSIWYG editor that allows you to design rich dynamic forms. Finally we demonstrated how to retrieve data from SQL Server and bind it to a control present in the InfoPath form. In Part-2 of this article, we will see how to interact with an ASP.NET Web Service from an InfoPath form and retrieve and submit data to the web service. The following is the source code for this two part article: InfoPath.zip - 52 kb. Thiru Thangarathinam has many years of experience in architecting, designing, developing and implementing applications using Object Oriented Application development methodologies. He also possesses a thorough understanding of software life cycle (design, development and testing). He is an expert with ASP.NET, .NET Framework, Visual C#.NET, Visual Basic.NET, ADO.NET, XML Web Services and .NET Remoting and holds MCAD for .NET, MCSD and MCP certifications. Thiru has authored numerous books and articles. He can be reached at thiruthangarathinam@yahoo.com. # # #
InfoPath 2003
September 5, 2003
Introduction
Architecture of InfoPath 2003
Operations that can be performed using InfoPath
Designing an InfoPath Form Template
Designing a Simple InfoPath Form
Click here for larger image
Figure 1.

Figure 2.

Figure 3.
function EmployeeSubmit::OnClick(eventObj)
{
XDocument.UI.Alert ("Employee ID : " +
eventObj.Source.selectSingleNode("//my:EmployeeID").text);
XDocument.UI.Alert ("Employee Name : " +
eventObj.Source.selectSingleNode("//my:EmployeeName").text);
XDocument.UI.Alert ("Employee City : " +
eventObj.Source.selectSingleNode("//my:EmployeeCity").text);
XDocument.UI.Alert ("Employee State : " +
eventObj.Source.selectSingleNode("//my:EmployeeState").text);
XDocument.UI.Alert ("Employee Zip : " +
eventObj.Source.selectSingleNode("//my:EmployeeZip").text);
}

Figure 4. Designing a Data-Bound InfoPath Form

Figure 5.

Figure 6.

Figure 7. Publishing an InfoPath form
Conclusion
Source Code
About the Author