devxlogo

Introduction to Microsoft Office InfoPath 2003

Introduction to Microsoft Office InfoPath 2003

t’s Monday. After arriving at the office, you fill out last week’s timesheet (Microsoft Excel), your expense report (a handwritten form), and your project status report (Microsoft Word). When you print these forms, you notice that soon you’ll need a new printer cartridge, so you e-mail a purchase request to the office manager using Microsoft Outlook. You also just brought back a book you’d borrowed from the company library, so you go to the internal Wiki and record that you’ve returned the book.

Paper forms, Excel, Word, Outlook, and the Wiki do an adequate job of allowing users to track information, but it seems there should be an easier way to gather, store, manage, and reuse this type of data across various applications. In fact, with your current suite of applications, information must often be re-entered in multiple systems, costing both time and data integrity. Of course, you could custom write or purchase several applications to perform these tasks, but these very basic needs shouldn’t be a big investment of time or money to handle. There should be a single application that allows simple data entry and easy integration of the data to other applications. Microsoft recognized this void in their Office application suite and, last autumn, InfoPath 2003 was unveiled.

Availability
InfoPath 2003 will be included in Microsoft Office Professional Enterprise Edition 2003, which can be purchased through Microsoft Volume Licensing programs. InfoPath 2003 does not require Office 2003 and will be available as a stand-alone program. Pricing information was not yet available at the time of this writing.

Where’s the Data?
InfoPath 2003 is an application that creates forms and shares data. At this point, your first questions are probably the same as ours. Where does the data get stored? What’s the big deal; I can do that with Microsoft Access or Microsoft .NET.

Data Source Selection
The Finished Form
Notice the Amazon hyperlink control in the form near the ISBN number. The expression for the link can be static or bound to a data source element. For the link expression, enter an XPath function to preface the ISBN field with the path to its Amazon page:
   concat('http://www.amazon.com/exec/obidos/ISBN=', @cISBN)

Clicking on the link from the preview brings up the book’s information page on Amazon. InfoPath 2003 also offers simple data validation using XPath expressions that can be easily added via the Data Validation dialog box. But the dialog box’s condition builder is limited to handling comparisons of field values or constants and doesn’t support expressions like validating that the ISBN field only contains numbers. For more complex validation, you can script the control’s OnBeforeChange, OnValidate, or OnAfterChange event. Here’s the script that uses a regular expression to verify that the ISBN is valid:

   function msoxd__Titles_cISBN_attr::OnValidate(      eventObj)    {      if(eventObj.Site.nodeTypedValueDoes It Do Any Tricks?
InfoPath 2003 contains many features to eliminate some normally tedious and complex tasks. For example, InfoPath 2003 provides various security features that are easy to implement, including form protection and protection from unsafe operations. In order for a user to access and fill out an InfoPath 2003 form, InfoPath 2003, like other Office 2003 products, needs to be installed on each client machine, providing both form design and input capabilities. There is no way to install only one or the other. InfoPath 2003 allows you to protect the form data from modification using digital XML signatures, or to protect a form by disabling the Design mode so that an end user doesn't accidentally modify a form.

InfoPath 2003's security model is based on the same security model implemented by Internet Explorer. This model protects your computer from unsafe operations by using security zones and levels. InfoPath 2003 uses these zones to determine the level of access that an InfoPath 2003 form can have to various resources on your computer. InfoPath 2003 forms that have full access to all system resources are called "trusted" forms. Although InfoPath 2003 does not directly support authenticating against Microsoft Active Directory Services Interface (ADSI), the InfoPath programming model does support extending a solution to include this.

InfoPath 2003 automatically insures that all users have the latest version of a form by providing built-in, transparent upgrading changed forms. InfoPath 2003 form templates are seamlessly downloaded in the background to the client computer each time a user clicks on an InfoPath 2003 form or attachment, eliminating the hassle of manually providing a mechanism to update each client computer. Without any extra effort on the developer's part, InfoPath 2003 allows the user to work offline. During the time that the InfoPath 2003 form is offline, InfoPath 2003 caches the form template information in a CAB file. When filling out the forms offline, the user can choose to save the data locally in an XML file and submit the information once they are connected again.

Combining InfoPath 2003 with Windows SharePoint Services makes sharing forms easy. Windows SharePoint Services (see the related article by John Durant in this issue) is a Web-based team collaboration environment that allows anyone with permission to create and access virtual workspaces across the Web. Windows SharePoint Services also manages multiple people sharing and working on a single document. InfoPath 2003 form templates can be saved directly to a Windows SharePoint Services form library that allows team members to share the same forms by accessing a single location.

InfoPath 2003 can prevent invalid data from being stored. During design time, InfoPath 2003 includes an Xpath-aware expression builder enabling attachment of extra validation rules to various controls. InfoPath 2003 automatically checks the validity of the data as it is typed into each control, rather than waiting until an entire form is completed. Data validation includes required entries, range checking, data types, etc. Because InfoPath 2003 uses XML schemas to define valid input internally, the schema itself insures the quality of the data. A user can save forms with invalid data, but they can't be submitted to a database or Web service.

Finally, one use (albeit non-mainstream) of InfoPath 2003 is as an XSLT generator. Because XSLT is difficult to write from scratch, the InfoPath 2003 Designer can be used to generate XSLT code. Like all visual tools, it has some limitations, but these can be overcome by designing regions within the generated code for custom written extensions.

So, What's the Bad News?
As robust as InfoPath 2003 is, there are a few caveats to be aware of before jumping on the InfoPath 2003 train. For example, if you want to use InfoPath 2003, it means recreating your existing forms from scratch. Although you can copy and paste information from your existing forms into an InfoPath 2003 form, you still need to insert InfoPath 2003 controls and complete the other aspects of the form design. InfoPath 2003 does not support importing scanned versions of existing paper forms.

Also, .NET developers will be disappointed that there aren't any managed code hooks. However, because InfoPath 2003's data can be stored in XML, there are plenty of options. Keep in mind that InfoPath 2003 is not really designed to be a developer's tool, but more of an end-user tool that enables non-developers to work with XML data easily.

Finally, although live, editable views are extremely easy to create, InfoPath 2003 does not have robust reporting capabilities. Keep in mind that the design intent of the product is to collect data and store it away for other applications to use, manipulate, and display. InfoPath 2003's power is in the ease of setting up the forms and collecting solid data, not in manipulation and reporting. You can certainly use scripting and XSLT to generate reports, but the skill set required is not that of the typical end user.

InfoPath 2003 allows an easy and accurate way to collect, share, and use information currently being gathered from various unrelated sources. InfoPath 2003 provides a WYSIWYG interface to create robust forms that conform to Office 2003 standards. Once the information has been collected, InfoPath 2003's ability to create a customer-defined XML file format provides an almost limitless way to interact with the data. By using InfoPath 2003, companies will be able to fully integrate data that was previously diversified.

devx-admin

Share the Post: