Creating repeating and multipage subforms

You can place a subform anywhere on a page; however, when a large amount of data is merged with the form, the subform may expand beyond the bottom edge of the rendered page. To deal with this issue, you can either select the Allow Page Breaks Within Content option to cause the server to break the subform in the middle or deselect this option to force the entire subform to the top of the next rendered page. Forcing a subform to the next page ensures that any nested subforms are displayed together on the same page. If you do not select the Allow Page Breaks Within Content option, you will probably want to create an overflow leader and overflow trailer subform. (See About overflow leaders and trailers .)

When data is merged, the server positions the content of a subform within the confines of content areas only. In cases where a large amount of data needs to be merged with any of the objects in a subform, a subform may span multiple form pages. When a form page is filled, the server automatically renders another identical page and continues to place the subform on the new page unless you explicitly direct the flow to a different content area or master page. When more than one content area or master page exists in the same form, you can specify whether a subform will be placed in a particular content area or positioned according to the specified master page.

To create a repeating subform

  1. In the Hierarchy palette, select the parent subform of the subform you want to repeat. (See About subforms .)

  2. In the Object palette, click the Subform tab, and in the Content list, select Flowed.

  3. Select the subform to repeat.

  4. In the Object palette, click the Subform tab and, in the Content list, select either Positioned or Flowed.

  5. Click the Binding tab and select Repeat Subform For Each Data Item.

  6. To specify the minimum number of repetitions, select Min Count and type a number in the associated box. If this option is set to 0 and no data is provided for the objects in the subform at data-merge time, the subform is not placed when the form is rendered.

  7. To specify the maximum number of subform repetitions, select Max and type a number in the associated box. If you do not specify a value in the Max box, the number of subform repetitions will be unlimited.

  8. To specify a set number of subform repetitions, regardless of the quantity of data, select Initial Count and type a number in the associated box. If you select this option and either no data is available or fewer data entries exist than the specified Initial Count value, empty instances of the subform are still placed on the form.

    Note: The value in the Initial Count box must be between the Min Count and Max values. If the Min Count value is not specified or is 0, the Initial Count value defaults to 0.

To specify a subform to span multiple pages

Subforms can be placed anywhere in a form design. However, when a large amount of data is merged, the subform may expand beyond the bottom edge of the rendered page.

To deal with this issue, you can either enable a page break in the middle of the subform or force the entire subform to be rendered starting at the top of the next rendered page. Forcing a subform to the next page ensures that any nested subforms are displayed together on the same page.

When data is merged, the content of a subform is placed within the confines of content areas only. In cases where a relatively large amount of data needs to be merged with any of the objects in a subform, a subform may span multiple form pages.

When a form page is filled, an additional identical page is rendered automatically. The subform continues to be placed on the new page unless you explicitly direct the flow to a different content area or master page. When more than one content area or master page exists in the same form, you can specify whether a subform will be placed in a particular content area or positioned according to the specified master page.

To enable a subform to span multiple pages

In the Object palette, click the Subform tab and select Allow Page Breaks Within Content.

When this option is deselected, the objects in the subform are kept together on the same page.

About overflow leaders and trailers

Because the length of a form that has a flexible layout varies depending on the amount of data merged with the form, forms that have a flexible layout are often longer than one page. Using overflow leader and overflow trailer subforms is an effective way to start and finish subforms that repeat over multiple pages. You can use any subform that is configured to position content as an overflow leader or trailer. For example, in the Purchase Order sample form, the detail subform is configured to position content and repeat for every data item. When the form is merged with data, if the first page has insufficient space to display all occurrences of the detail subform, a new page is added and the data continues to flow into the next content area.

When data flows this way across multiple pages, you may want to carry forward onto each new page certain text such as “Continued from previous page” or specific formatting elements such as a column header row that includes the descriptive labels for each column of data. Using column header rows on each subsequent page makes the resulting form much easier for users to follow. To do this, you can create an overflow leader subform that will act as the column header row for each additional page. In the Purchase Order sample form, for example, the detailHeader subform is selected as the overflow leader. As a result, a copy of the detailHeader subform is rendered at the top of every new page before the first occurrence of the detail subform.

Similarly, you may want to include information following the last occurrence of the repeating subform, at the bottom of all pages except the last page. For example, you may want to include text such as “Continued on next page” at the bottom of these intervening pages. To do this, you can create an overflow trailer subform for the repeating subform in the same way that you created an overflow leader subform.

When a subform overflows to the new page, the server performs these operations:

  • Places the overflow trailer on the current page

  • Places the overflow leader on the next page

  • Flows the expanding subform and the remainder of its repeating objects onto the new page

An overflow leader is a special type of positioned subform that appears at the top of the next page whenever a page overflow occurs.

Overflow leaders are similar to the heading row in a standard table. The heading row appears at the top of the table and contains a descriptive label for each of the columns in the table. You can format the table so that when it expands beyond one page, the heading row is repeated at the top of the new page. This makes the information in the table easier to understand as the reader moves from page to page.

An overflow leader subform behaves in a similar way. When you specify that a specific subform will be the overflow leader for a subform that repeats, the overflow leader subform will appear once before the repeating subform at the top of the current page and each subsequent page thereafter.

The repeating subform is added as many times as necessary when merged with data. When there is no more room on the first page, a new page is added and the data continues to flow into the next page until all the data is consumed. The overflow leader subform will appear once at the top of each page.

You can see an example of how an overflow leader subform is used in the sample form design whose layout adjusts to accommodate data that is included with Designer. The sample, Purchase Order.xdp, is in the Samples folder where Designer is installed on your system. In that example, the subform named detailHeader acts as the overflow leader for the repeating subform named detail.

Bookend leaders are subforms that appear before a repeating subform. If you define a subform sibling just above a repeating subform and then specify it as an overflow leader, you have defined it as a bookend leader and as an overflow leader.

An overflow trailer appears at the bottom of the next page whenever a page overflow occurs. Use an overflow trailer to include information that appears only once, after all the data is positioned.

Bookend trailers are subforms that appear just below a repeating subform. If you define a subform just below a repeating subform and then specify it as an overflow trailer, you have defined it as a bookend trailer and as an overflow trailer.

To create and assign overflow leaders and trailers

An overflow leader or overflow trailer is a positioned subform that can be assigned to any repeating subform. Typically, you create the subform that will become overflow leader or trailer first. Then you assign them to a repeating subform and give them overflow properties.

If the overflow leader is also treated as a bookend leader, it is placed in the Hierarchy palette just above the subform. Also, if the overflow trailer is also treated as a bookend trailer, it is placed in the Hierarchy palette just below the subform.

To create an overflow leader or overflow trailer subform

  1. Create a form design with all the necessary subforms.

  2. On your form design, locate the subform that you want to use as an overflow leader or an overflow trailer, select the subform, and do these tasks:

    • Look at the Subform tab in the Object palette. Ensure that the Content list displays Positioned. In the Object palette, click the Subform tab and make sure that Positioned is selected in the Content list.

    • Look at the Binding Tab in the Object palette. In the Object palette, click Binding tab and select Repeat Subform For Each Data Item to have the leaders and trailers appear for more than one overflow. Bookend leader and trailers are not counted against this number.

To apply an overflow leader or overflow trailer to a subform

  1. Select the subform or subforms that you want to repeat.

  2. In the Object palette, click the Binding tab and select Repeat Subform For Each Data Item to set the subform to repeat.

  3. In the Object palette, click the Pagination tab and, in the Overflow box, specify either a content area or page where the form should place the overflow subforms.”]

  4. If you want to specify an overflow leader, in the Overflow Leader list, select the subform that you want to use as the overflow leader subform for the current repeating subform. Alternatively, select New from the Overflow Leader list to create and assign a new overflow leader subform.

  5. If you want to specify an overflow trailer, in the Overflow Trailer list, select the subform that you want to use as the overflow trailer subform for the current repeating subform. Alternatively, select New from the Overflow Trailer list to create and assign a new overflow trailer subform.

    Note: You do not need to have both an overflow leader and an overflow trailer. Whether you have one, both, or none is determined entirely by the requirements of your form.

// Ethnio survey code removed