Working with Parts

Layouts are made up of parts. Depending on your objectives, your layout may contain header and footer parts, a body part, one or more subsummary parts, and maybe even a leading or trailing grand summary. Every layout must contain at least one part.

Briefly, the purpose and some characteristics of each type of part are as listed here:

For more information about using summary fields and summary parts to create reports, see "Summarized Reports," p. 287.

Adding and Ordering Parts

There are two ways of adding parts to a layout. The first is by clicking and dragging the Part button in the Status Area to the point where you want the new part to appear. You are prompted to select a part type when you let up the mouse. Although it is convenient, we discourage this method of adding new parts. New parts, except when added to the very bottom of the layout, always come at the expense of existing parts. That is, if you have a 50pixel header followed by a 200pixel body, and you attempt to add a subsummary between these parts, the body part shrinks by the size of the subsummary part. Moreover, fields that were in the body part may now be part of the subsummary part.

The other option for adding new parts, which we prefer in almost every circumstance, is to use the Part Setup dialog (shown in Figure 4.9), which can be found under the Layouts menu. When parts are added with this tool, it's not at the expense of any existing part; the total height of the layout increases.

Figure 4.9. You can add, edit, delete, and reorder the parts on a layout from the Part Setup dialog.

The Part Setup dialog can also be used to reorder, edit, and delete parts. The only types of parts that can be reordered are the body and subsummary parts. To reorder these, click the arrow in front of the part name and drag it to the desired position. Other part types appear with a lock in front of them, indicating that they are fixed in a certain order by definition.

You can delete a part from a layout either by selecting it from the Part Setup dialog and clicking Delete, or by clicking the part label while in Layout mode and pressing the Backspace or Delete key on your keyboard. Either way, when you delete a part, any objects contained in that part are also deleted.

Formatting a Part

You can configure a few attributes of parts directly from Layout mode itself. First, you can set a background color and/or fill pattern for a part by clicking on the part label, and then selecting a color and/or fill pattern. (Control-clicking) [right+clicking] on the part label similarly pulls up a contextual menu with access to these attributes.

You can achieve much the same effect simply by drawing a large rectangle on the layout, sending it to the back, and locking it. Setting a background color for the part is preferred, though, because the color extends to the right and downward if the user expands the window beyond the boundaries of your rectangle.

Tip

For users with monitors set to higher resolutions than your database was designed for, consider adding a footer with a background color different from your body part so that users can visually see where the layout "ends" and size their windows appropriately.

You can also change a part's size. To do this, simply click on the dividing line between two parts and drag either up or down. When making a part smaller, you can remove whitespace from the part, but you are prevented from dragging through any objects in the part. Any expansion of a part increases the overall size of the part.

Holding down (Option) [Alt] as you resize a part changes the rules slightly. First, any expansion or contraction comes at the benefit or expense of the neighboring part; the overall height of the layout remains the same (except, of course, when enlarging the last part on the layout). Also, you can "run over" objects this way; an object that was in one part may end up belonging to another part after you've resized things. An object that ends up straddling two (or more) parts belongs to the part that contains its upper-left corner.

The Size palette can also be used to see and set a part's length. This is the best way to precisely set part lengths, especially when trying to duplicate complex layouts from one file to another. Click the part label to display that part's data in the Size palette.

For more information about the Size palette, see "Positioning Objects on a Layout," p. 109.

 

Part Definition

Beyond the size and background color of a part, some part attributes can be set only in the Part Definition dialog, shown in Figure 4.10. You can get to this dialog either from the Part Setup dialog (by clicking Create or Change), or by double-clicking on the part label itself.

Figure 4.10. The Part Definition dialog is used to specify a part's type and attributes.

The type of part is indicated by the radio buttons on the left side of this dialog. You can change the type of a part simply by selecting a different radio button. If a type is grayed out, that means you already have a part of that type. The only part type for which you can have multiples is subsummary.

The fields on the right side of the dialog apply only to subsummary parts. When you make a subsummary part, you must specify which field will act as the break field for the summary. The break field doesn't need to actually appear in that part, but the found set must be sorted by the break field for the subsummary part to appear on a report.

For more information on break fields and subsummary reports, see "Summarized Reports," p. 287.

At the bottom of the dialog are some options for configuring page breaks and page numbers. Often in subsummary reports, you'll want each new subsection to start on a new page. To do this, you would edit the part definition of the subsummary part to include the Page Break Before Each Occurrence option. As you would expect, it's actually only each occurrence after the first one that's preceded by a page break.

You can also opt to use the Alternate Background Fill feature. This option is available only on body parts. Any color and/or fill that you specify is used as the background for every other record. It alternates with any background color that has been specified for the part itself. Often, a slight shading of alternate rows on a report makes it easier to read.

Категории