A layout is made up of layout partssections that each behave a little differently when displaying or printing multiple records. Even the simplest layout has at least one part, and each part has objects on it. One kind of object is a field, which you've seen plenty of so far in this book. Each field in your database has a little label beside it that tells you which field it is. These labels are another kind of object: they're text objects. It just so happens those objects all belong to a part called the body, and if you need to talk about your layout, you'd say they are on the body.
Parts tell FileMaker how to treat the objects inside them when it displays or prints the layout. One part might show just once at the top of the window, while another shows over and over again for each record. This section tells you exactly what each part type does and when to use it. Finally, you'll learn how they work together and how they behave in each mode.
4.3.1. Layout Parts
FileMaker has eight different kinds of parts in all. Every layout uses at least one of these parts, and often severalalthough not all databases need all eight kinds of parts. Most types can occur only once on each layout (like a header), while others can appear several times.
Figure 4-4 shows a layout with seven partsone of each type except sub-summary.
184.108.40.206. Parts in form view
When in Browse mode, and viewing the layout as a form, you see every part except sub-summary parts. As Figure 4-4 shows, the parts go in the same order as in the list on the previous page. In practice, you'll probably never use all these parts on a layout you plan on viewing this way. In fact, if you only ever want to view a layout as a form in Browse mode, you really need only a body part.
If the window isn't big enough to show every part, you get scroll bars as usual. In form view, the entire layout scrolls up and down, as shown in Figure 4-5.
220.127.116.11. Parts in list view
In list view, the header is anchored to the top of the page and the footer to the bottom. When you use the scroll bars, the header and footer stay in place and the body part scrolls. If you resize the window, the footer moves with it so that it is always the same height, and always at the very bottom.
List view is a list because it shows several records at once. FileMaker accomplishes this magic by repeating the body part once for each record. The database in Figure 4-2 has three records, so in effect, the body part repeats three times.
The leading grand summary shows directly below the header, and before the body part's first appearance. The trailing grand summary, on the other hand, shows right after the last record's body part.
Scrolling in List view is altogether different from Form view, as shown in Figure 4-6.
18.104.22.168. Parts in Preview mode
Figure 4-6 might lead you to believe that Preview mode shows only the title header and footer (exactly the opposite of list view) but that's not the whole story. Turn your eyes to Figure 4-7 for the whole story.
Just like list view, the grand summary parts place themselves before the first record and after the last record. Finally, scrolling in Preview mode just scrolls the current page. If you need to see other pages of your report while you're in Preview mode, use the Book icon to move around.
22.214.171.124. When to use 'em
While it's perfectly legal to put any parts on any layout, you can probably tell from the discussion above that some arrangements are more common than others:
4.3.2. Layout Objects
Parts aren't so useful by themselves. They control how the items in your layout arrange themselves on screen or on the page, but they need to have things in them to be really useful. You call those things layout objects. Layout objects come in six flavors: Text objects, lines and shapes, images, fields, portals, and tab controls.
Note: Portals are all about relationships, and you won't learn about relationshipsor portalsuntil Part 4. You'll take up tab controls a little sooner. Look for them in Chapter 6.
126.96.36.199. Text objects
Almost every layout ever created has included text objects: little blocks of text that are the same on every record displayed using that layout. Think about what happens when you move from record to record. The text labels for each field stay the same, even though the data inside each field changes with every record. Text objects give you one form of stability in the ever-changing world of database records.
When you design a layout, you can control every aspect of a text object, from the words in it to the font, size, style, color, line spacing, tab stops, and so on. (In fact, everything you learned in Chapter 2 related to formatting text in fields applies to text objects on layouts as well.)
Tip: FileMaker's spell checker works in layout mode too. Just choose Spelling Check Layout. It looks and works just as it does in Browse modeexcept that it checks text objects on the current layout. Also, the
188.8.131.52. Lines and shapes
If you need simple graphic embellishments in your layouts, FileMaker has built-in tools. For example, you might want to put a box around a person's address information, and another around the Notes field, so they are visually separated. You can draw lines, rectangles, ovals, and round-cornered rectangles right on your layout. You can also control the line color, thickness, and pattern for lines and shapes; and the fill color and pattern for shapes.
If simple shapes can't properly convey your artistic vision for your layout, you have recourse: You can paste any picture right on to the layout. You can also insert a picture from a file on your hard drive. Database developers often add icons, logos, and other decorations this way. For example, you might add your company logo to the top-right corner of your layout, or put a cute little envelope icon by the Email Address field. Just remember a little of this "eye candy" goes a long way. If you get carried away, you can actually create so much visual clutter that people using the program are confused, instead of enlightened.
A layout without fields is just a picture. Perhaps it's a very complex picture that changes as you switch from list view to form view, and has an entirely different effect when printed (thank you, parts!), but it's a picture nonetheless.
To get data into your layout, you add field objects. For instance, if you make a new layout in the People database, and you want to show the person's address, you can add the Street Address, City, State, and Zip Code fields to the body part of the layout. If the field is in the body part (the most common place), then it shows data from the current record (or each record when you view the layout as a list). In list view, fields in header, footer, or grand summary parts show the values from the first or last record in the found set. In Preview mode (or when printing), headers and footers show data from the first or last record on each page.
Note: You won't usually put ordinary fields in header, footer, and grand summary parts. These parts usually contain global fields, summary fields (see Section 6.9), page numbering, dates, or just text and pictures.
With a firm understanding of layouts, views, parts, and objects, you're ready to get down to business. The next section shows you how to put all these ideas to work in your own databases.
Part I: Introduction to FileMaker Pro
Your First Database
Organizing and Editing Records
Building a New Database
Part II: Layout Basics
Advanced Layouts and Reports
Part III: Multiple Tables and Relationships
Multiple Tables and Relationships
Advanced Relationship Techniques
Part IV: Calculations
Introduction to Calculations
Calculations and Data Types
Part V: Scripting
Part VI: Security and Integration
Exporting and Importing
Sharing Your Database
Part VII: Appendixes
Appendix A. Getting Help