Publishing an InfoPath Form Template

 < Day Day Up > 

To make a form template available for use by a group of users, you need to publish the form template. In InfoPath 2003, publishing a form template is supported by the Publishing Wizard. Three options are offered : publishing to a shared folder, to a SharePoint site, and to a Web server. Some or all of these options may be relevant to your needs.

Publishing to a Shared Folder

One option is to publish to a shared folder. To publish the ADO_CON sample form template (which is part of the InfoPath SDK) to a shared folder, follow these steps:

  1. Open the form template in design mode.

  2. Select Publish on the File menu. The first screen of the Publishing Wizard opens (see Figure 9.5).

    Figure 9.5. The first screen of the Publishing Wizard.

    graphics/09fig05.gif

  3. Click Next . On the following screen, you are offered three choices:

    • Publish to a shared folder

    • Publish to a SharePoint form library

    • Publish to a Web server

    First we will choose to publish the ADO_CON.xsn form template to a shared folder on the local machine. Ensure that the shared folder option is selected (the default), and click the Next button.

  4. On the following screen (see Figure 9.6), click the Browse button.

    Figure 9.6. Browse for the location of the shared folder.

    graphics/09fig06.gif

  5. Click My Computer in the left panel of the Browse window, and double-click on the Shared Documents folder to open it. With the Shared Documents folder open, click the OK button. The file path for the Shared Documents folder is inserted into the Publishing Wizard window, which is shown in Figure 9.6.

  6. On the following screen, we are asked whether the file path is sufficient for all users. If it isn't, modify the file path or URL. Click the Next button.

  7. On the following screen, the Notify Users button (see Figure 9.7) allows us to email users to inform them of the newly published form template.

    Figure 9.7. The Notify Users button allows users to be notified of a newly published form template.

    graphics/09fig07.jpg

    Clicking the Notify Users button opens the Outlook mail client (see Figure 9.8) with a template email message that you can edit to suit your local needs.

    Figure 9.8. A template email message.

    graphics/09fig08.gif

  8. Back in the Publishing Wizard window, check the Open This Form From Its Published Location check box and then click the Close button.

Probably to your surprise, instead of seeing your published sample form, you will see a dialog that demands information about how to connect to the Access database (see Figure 9.9).

Figure 9.9. The dialog box requesting database connection information.

graphics/09fig09.gif

What has gone wrong? The ADO_CON.xsn form template connects to an Access database, infnwind.mdb . Before publication, the infnwind.mdb database file is situated in the same directory as the unpublished form template. After publication to the shared folder, the relative path to the infnwind.mdb file is no longer correct, and you therefore are shown the dialog in Figure 9.9.

The problem is easily solved in this casecopy the infnwind.mdb file to the shared folder, and the sample InfoPath form template will work as intended. If you see the dialog shown in Figure 9.9, it is very likely that you have a path or permissions problem that is preventing access to the Access or SQL Server database required for proper functioning of the form template.

If you click the Cancel button on the dialog in Figure 9.9, you will be shown an error message indicating that InfoPath couldn't connect to the database.

Publishing to a Web Server

To publish to a Web server, follow these steps:

  1. Open the form template in design mode.

  2. Select Publish on the File menu to start the Publishing Wizard. Click Next.

  3. Select the third option button (To a Web Server) and click Next.

  4. On the next screen (see Figure 9.10), enter the URL to which the form template is to be publishedin this case, http://localhost/ADO_CON.xsn . Click Next.

    Figure 9.10. Specify a URL for the Web server to which the form template is to be published.

    graphics/09fig10.gif

  5. If a form template of the same name already exists, a warning will be displayed (see Figure 9.11).

    Figure 9.11. Warning about an existing published form template.

    graphics/09fig11.gif

    In this case, we can select the overwrite option because we simply want to demonstrate the warning. However, in a production setting, you need to think carefully about what you want to do. By publishing a second form template to a URL, you are in effect risking being unable to use any forms that used the previous form template published to that URL.

  6. In a production setting, you might want to choose the Publish to Another Location option. Clicking Next allows you to enter an alternative URL. After you have entered the alternative URL, and assuming that this URL isn't already the URL of a published form template, you will be taken to the final screen. Click Finish, and the form template should be accessible from the URL you specified.

  7. To test that the form template has been published correctly, enter a URLfor example, http://localhost/ADO_CON.xsn in Internet Explorer. If this is the first time you have tried to access a form template using Internet Explorer, you will receive a warning asking if you want to open an .xsn file. You might also want to uncheck the Always Ask Before Opening This Type of File check box, so that opening other InfoPath form templates is smoother. Click the Open button.

This is the same issue about access to the Access database that I mentioned in the previous section in relation to publishing to a shared folder. The Access database needs to be copied to a location where the relative path used in the connection string is correct.

 < 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