|
SYS-CON.TV Webcasts
Comments
Did you read today's front page stories & breaking news?
SYS-CON.TV
|
Top Links You Must Click On
Best Practices Introduction to InfoPath 2003
Data where you want it, when you want it
By: Tina Zuffoletti
Mar. 22, 2005 12:00 AM
InfoPath 2003 is Microsoft's answer to the next generation of electronic forms that enables users to do business electronically. It is a powerful forms-creation tool and a key application released with the Microsoft Office 2003 suite that can be used as an interface to help gather information more effectively. The main focus for InfoPath is collaboration and enterprise integration. By using a variety of XML standards to capture data it enables any XML enabled system to easily consume the data. The InfoPath development environment provides developers with a simple drag-and-drop interface for creating professional-looking forms using familiar controls, such as check boxes, drop-down lists and text boxes. The controls are easily bound to data entered either in the form or referenced from external data sources. Well-known Office features are also available out-of-the-box like Spell checking and rich text editing and AutoComplete. By using inherent validation, errors can be reduced and common problems with paper or electronic forms including bad data, inflexible or unusable forms and errors in business logic can be eliminated. The program creates forms using out-of-the-box templates to accommodate common office forms. Or the developer can design a form from scratch and add custom functionalities. Developers can create templates based on custom XML schemas and then build intelligent applications around these documents. By providing support for the Extensible Stylesheet Language (XSL) and XPATH, reusability across platforms that support these W3C standards is possible. It's important to understand that InfoPath is built on a foundation of XML standards. The integrated use of standards such as SOAP makes it easy to share data with systems that are enabled for XML Web Services. The Service Pack 1 (SP1) release also includes support for managed code that further extends the limits of InfoPath forms functionality. Table 1 shows a breakdown of the files generated by the designer. The breakdown on an InfoPath 2003 solution file (xsn) InfoPath forms are published to a shared location for the consumption of users. Once published the forms are available for entering and storing data. The developer will publish the form to a shared location. It could be a shared location on a personal computer, a folder on a network share or collaboration storage like a WSS site in SharePoint. Users can browse to a form template. InfoPath then opens the template and the user can fill out the form. When the user saves the form, the data entered is saved as an XML file. It's important to note is that InfoPath 2003's security model is based on the same security model implemented by Internet Explorer. InfoPath 2003 automatically insures that all users have the latest version of a form by providing built-in, transparent upgrading changed forms. It's also important to note that security updates included in Office 2003 SP1 for InfoPath 2003 let forms designers provide digital signature support. InfoPath users can sign different parts of a form and see the form as it existed when an individual digitally signed it. I have covered the basic functionality of InfoPath 2003. The next section will demonstrate creation of a sample form from an existing data source. Creating a Form from a Data Source From the right hand menu select "New from Data Connection." Choose Database and click next. Choose Select Database and Browse to the northwind.mdb; the default location is c:\Program Files\Microsoft Office\OFFICE11\Samples. The Select Tables dialog box displays. Choose the Products table. The Data Connection wizard displays. Click next, leave the name as the Main Connection, and click finish. The Select tables dialog box displays Choose the Products table. The Data Connection wizard displays. Click next, leave the name as the Main Connection and click finish. Change the title to Product Information. Under the Main data section on the right-hand menu, click on the dataFields folder to highlight it. Click the down arrow and select Section with controls. A form is generated with the data from the product table in a repeating section control. Next, click on the save icon on the top menu, then click on the publish button and save the template.xsn file to a folder on the local hard drive. Then navigate to the path where the .xsn file is saved and double-click on the file. The form displays in a user mode. Enter the number 1 in Product ID, Test Product under Product Name and the word Test in Supplier ID. Note the dotted red box surrounding the Supplier ID value. InfoPath provides basic validation based on the Schema for the data field. Since Supplier ID is defined as a numeric value, entering alpha characters caused the validation of the form to fail. Correct the value to a 1 and select false under the discontinued drop-down list box. Click on the insert Item drop-down arrow and notice that another area appears allowing a second row of data to be entered. This is because the control is a repeating section. Click Save under the file option from the top menu. Save the file as TestProduct.xml. Navigate to the XML file and open with an XML editor or notepad. View the XML that was created for the test data entered.
<?xml version="1.0" encoding=" UTF-8"?>
<?mso-infoPathSolution solutionVersion="1.0.0.2" initialView="View 1"
productVersion="11.0.6357" PIVersion="1.0.0.0"
href="file:///C:\Documents%20and%20Settings\zuffolettit\My%20Documents\
Infopath%20article\Product.xsn" name="urn:schemas-microsoft-com:office:infopath:
Product:-dataFormSolution" ?>
<?mso-application progid="InfoPath.Document"?>
<dfs:myFields xmlns:q=
"http://schemas.microsoft.com/office/infopath/2003/ado/queryFields"
xmlns:d="http://schemas.microsoft.com/office/infopath/2003/ado/dataFields"
xmlns:dfs="http://schemas.microsoft.com/office/infopath/2003/dataFormSolution"
xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/
2004-11-29T20:20:02" xml:lang="en-us"
xmlns:xdado="http://schemas.microsoft.com/office/infopath/2003/adomapping"
xdado:dataModified="">
<dfs:queryFields>
<q:Products ProductID="" ProductName="" SupplierID="" CategoryID=""
QuantityPerUnit=""
UnitPrice="" UnitsInStock="" UnitsOnOrder="" ReorderLevel="" Discontinued=""/>
</dfs:queryFields>
<dfs:dataFields>
<d:Products ProductID="1" ProductName="test" SupplierID="1" CategoryID=""
QuantityPerUnit=""
UnitPrice="" UnitsInStock="" UnitsOnOrder="" ReorderLevel="" Discontinued="False"/>
</dfs:dataFields>
</dfs:myFields>
Notice the data entered under product name and supplier. The forms that are filled out and saved are now available for processing. Summary InfoPath can be a simple tool for team members to collect data or it can be much more robust supporting access to Web Services and integration with SharePoint, BizTalk and other enterprise systems. Since InfoPath 2003 SP1 supports managed code, the possibilities of creating very robust applications with InfoPath forms are very promising. Reader Feedback: Page 1 of 1
Enterprise Open Source Magazine Latest Stories . . .
Subscribe to the World's Most Powerful Newsletters
Subscribe to Our Rss Feeds & Get Your SYS-CON News Live!
|
SYS-CON Featured Whitepapers
Most Read This Week |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||