Saving Form Templates and Forms

 <  Day Day Up  >  

When we created InfoPath form templates in earlier chapters, we simply saved them to the local hard disk as we progressed through their design and testing. This allowed us to work on the form template knowing that nobody else would have access to it until we decided it was ready for public use. Now we will look a little closer at the basic functionality of saving to understand what is happening.

One basic issue about saving that you need to understand is whether you are saving a form template ( .xsn file) or an InfoPath form ( .xml file). The type of entity you are saving is determined by the InfoPath mode you are in: design mode or form-filling mode.

Saving in Design Mode

When you choose to save in design mode, you are saving a form template either as an .xsn file or as a folder of extracted form files. If InfoPath provides all the functionality you need from the InfoPath user interface, you will typically save as an .xsn file. However, when you need to add functionality to a form template beyond that provided in the InfoPath 2003 user interface, you will need to extract the files from the form template and hand-edit them. The next time you save the form template, you will be saving a bunch of separate files.

Saving a Cabinet File

The .xsn form template file is a cabinet file . You may be familiar with these from installing Microsoft software. In that setting, cabinet files typically have a .cab suffix. The .xsn file contains several files and provides a more easily portable format to disseminate the form template, compared to separate files.

When you choose to save an InfoPath form template, you are offered the choice of saving it or publishing it (see Figure 9.1), unless you have checked the Don't Show This Message Again check box (which is displayed if you choose the Save As option from the File menu). Click the Save button, and a Save As window opens.

Figure 9.1. The choice to publish or save a form template.

graphics/09fig01.gif

The only option available is the .xsn (form template) file. When you click the Save button, the form template will be saved as a single cabinet file with an .xsn file extension.

Saving Separate Files

The InfoPath use interface provides support for many basic design and development needs; but for more complex development needs, you will need to be able to access individual files that are contained in the form template ( .xsn file). To save the files contained in the cabinet file as separate files, select Extract Form Files from the File menu to open the Browse for Folder window (see Figure 9.2).

Figure 9.2. The Browse for Folder window.

graphics/09fig02.gif

Select a suitable folder. After you click the OK button, the files that make up the form template are extracted as separate files to the chosen folder. Each of the files can then be edited, as appropriate.

To learn more about the files that make up the form template, see "The Content and Purpose of the .xsn File," p. 259 .


Saving Script Files

The Microsoft Script Editor provides a Save option on its File menu. You can use this option to save JScript or VBScript files. You shouldn't need to explicitly save script files, because they are saved when a form template is saved.

REPACKING THE FORM TEMPLATE

When you extract the form template's files, you will normally hand-edit one or more of them. InfoPath does not provide any command to repack the files into an .xsn file; but when you publish the form template to its final location, the form template is repacked into an .xsn file.


Saving in Form-Filling Mode

When filling out a form in InfoPath, many scenarios can arise in which it isn't convenient or possible to submit the form to a database or XML Web service. For example, a salesperson might not have an Internet connection for many hours while visiting client sites. For the sake of efficiency, he might want to enter data into the relevant InfoPath form as it becomes available. However, he might be unable to submit the form until some summary information is added after he leaves the client site, or he might simply have to wait until he has an Internet connection before submitting the client data.

Saving a Form

After a form is opened in form-filling mode, you might not be able to enter all the data at once. If you open the SimpleHR.xsn template from c:\IKS\Ch01 and then choose to save it (the Save As option from the File menu), the Microsoft Office InfoPath window opens (see Figure 9.3) and offers the option to save or submit.

Figure 9.3. The option to save or submit.

graphics/09fig03.gif

Click the Save As button, and the Save As window opens. We will save the file as c:\IKS\Ch09\TestSave.xml . Click the Save button.

Open TestSave.xml using Notepad (seen in Figure 9.4, which is edited to avoid long horizontal lines of code). Notice that it has an href pseudo-attribute in the mso-infoPathSolution processing instruction. The value of the href attribute indicates the location of the form template. When the form template is located on the local machine, as it will likely be during form development, the value of the href attribute is a file location on that machine. However, with a published form template on a remote server, when the user's machine is offline, the value of the href attribute continues to point to the form template's original location, but the form template used is stored in a local cache.

Figure 9.4. TestSave.xml opened in Notepad.

graphics/09fig04.gif

Saving a Form to a Form Library

An InfoPath form can also be saved to a form library on a Windows SharePoint Services (WSS) or SharePoint Portal Server 2003 site. In some respects, saving a form to a SharePoint form library is similar to submitting a form, as described later in this chapter.

To learn more about using InfoPath with Windows SharePoint Services, see "Creating a Form Template and Form Library," p. 232 (Chapter 13).


Exporting a Form to the Web

InfoPath 2003 allows the user who is filling in an InfoPath form to export the form (or, more specifically , a specified view from a form) to an MHTML file on a Web site. The Export To option is absent from the File menu in design mode. Unfortunately, the MHTML snapshot of the InfoPath form view that is produced by exporting to the Web is just that ”a snapshot in time. The MHTML file has no functionality apart from allowing someone to enter a URL and then view the snapshot in a browser.

For users who have the InfoPath client, exporting to MHTML serves little useful function. But this functionality might be useful to their colleagues or clients . For example, if a safety inspector fills in an InfoPath form template on a site inspection, the filled-in form can be exported to MHTML for the site manager, who might not have the InfoPath client.

INFOPATH 2003 AND THE WEB BROWSER

It is not possible to fill out InfoPath 2003 forms in Internet Explorer or any other browser. The automation functionality supported in InfoPath 2003 is not sufficient to allow the InfoPath 2003 client to be embedded in Internet Explorer.


SHOP TALK
USING INFOPATH ON THE WEB

One of the recurring topics on InfoPath newsgroups and mailing lists is how to use InfoPath with a Web browser. Prospective users of InfoPath find it incredible that there is no way to fill in an InfoPath form template using a Web browser.

Exporting an InfoPath form (not form template) to the Web as an MHTML file is the only Web functionality in InfoPath 2003. However, the MHTML file only allows other users to view the state of a form's view at a particular point in time. As mentioned earlier, doing so can be useful as a record of, for example, a site visit.

The reason for this limitation is that Microsoft intends InfoPath 2003 to be an enterprise forms tool, with its focus on integration with other Microsoft tools such as relational databases (SQL Server and Microsoft Access) and Microsoft business servers through XML Web services. InfoPath 2003 is meant to be a rich client (which is also a paid-for client) for use in an intranet setting, rather than a Web browser plug-in to allow general Web forms functionality.


 <  Day Day Up  >  


Microsoft Office InfoPath 2003 Kick Start
Microsoft Office InfoPath 2003 Kick Start
ISBN: 067232623X
EAN: 2147483647
Year: 2004
Pages: 206

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net