Flylib.com

Books Software

 
 
 

Using an Optional Section with a Layout Table


Using an Optional Section with a Layout Table

Adding the optional business group to the form shows you how to add an optional section without controls to the repeating section and then add a layout table with controls to the optional section.

To add an optional section with a layout table for the business group, follow these steps.

Add the optional section and controls

  1. Open the Data Source task pane, drag the business group node below the personal group table, and choose Section.

  2. Right-click the Section tab, and choose Section Properties to open the Section Properties dialog box.

  3. Select the Do Not Include The Section In The Form By Default option, and select the Allow Users To Insert The Section check box to make the section optional.

  4. Select the Show Insert Button And Hint Text check box, and type Click Here to Insert Business (Work) Address or something similar in the text box, as shown here. If you don t mark the check box, the optional section placeholder isn t visible. Click OK.

    click to expand

  5. Drag the business group node to the optional section, and choose Controls In Layout Table to add a two-column, nine-row table. Expand the width of the table to the full width of the optional section.

  6. Select column B, split the column into four columns (remembering to deselect the merge columns option), adjust the column widths, and relocate label/text-box pairs as you did earlier in the section Splitting Table Cells and Moving Cell Contents. Look ahead to Figure 5- 4 for layout guidance.

  7. State and ZIP Code labels and resized text boxes fit within a single right column, so split row 3, column E into three columns, and move these two label/text-box pairs to the split cells.

  8. Delete the four empty rows, add a caption, reduce the height of the optional section and repeating section, and drag the bottom of the master table to the bottom of the repeating section.

  9. Save your changes, and click Preview Form to check your work so far. Figure 5-2 shows the preview with the optional section added.

    click to expand
    Figure 5-2: This preview shows the Contact1.xsn template s final design.

The examples in this chapter illustrate layout and formatting techniques but don t duplicate topic coverage in previous chapters, such as specifying required fields and testing templates. However, it s a good practice to verify that the forms you create with a new design methodology generate the data document you re expecting and that repeating sections merge correctly. To perform the test, create two forms using the default data, and then merge them to verify that all fields of repeating sections appear in the merged document.

Note  

Using the sample source and merged files
Your C:\Microsoft Press\Introducing InfoPath 2003\Chapter05\Contacts folder contains the completed Contacts1.xsn template and two sample data documents, Contacts1Test.xml and Contacts1Merge.xml, which have been merged into Contacts1Test+Merge.xml to verify that the repeating sections merge correctly



Adding Table Borders

At this point, the form you ve produced is short on graphic accouterments. You can spiff up the form a bit by adding borders to your tables. Adding borders, like adding dividing lines, aids users in identifying specific form sections. You also can add cell divider lines.

Following are methods for adding specific types of borders to the tables you added to the Contacts1.xsn template:

  • To add a border around the master form, click the master table s selection handle at the upper left of the table, and choose Table, Borders and Shading. Then click the Outline button, and select a border width, such as 2 1/4 points. For each border that you want make different, click it and make the changes. (If you don t click the four outside border buttons , the width remains the default 1 point.) Borders around the entire table don t contribute to usability; add them only if they re needed to conform to graphic standards.

  • Use the same technique to add an outside border to an individual table, but reduce the width to 1 1/2 points or fewer. To improve readability, set label cell Left Padding to 3 pixels.

  • When you add the border around a master form with a title, the light gray border under the title disappears. To restore it, add a horizontal, 6-point, light gray inside border to the master form. It s also a good design practice to add a space in front of the title text.

  • If you decide to add inside (cell) borders, accept the default 1-point width.

Figure 5-3, on the next page, illustrates that adding borders around all table elements leads to a harsh appearance and contributes little or nothing to the form s usability. (This version is Contacts1Borders.xsn.)

click to expand
Figure 5-3: This version of the Contacts1 form has every possible border added.