FileMaker has the power to take you beyond simple totals. Using the Sub-summary layout part, you can produce reports that display subtotals for any field. For example, you can create a report that shows sales totals broken out by state and, within each state, broken out by payment type.Youll need to manually add a Sub-summary part to a layout. Although you can create a Sub-summary part with the Layout Assistant when you first design a layout, the Assistant cant be used to modify existing layouts.
To add a Sub-summary part to a layout
1 .Choose View > Layout Mode (Control+L/Command+L). Switch to the layout to which you want to add sub-summaries.This example uses the Sales Report layout created in "To create a layout with summary parts," earlier in this chapter.2 .Click the Part tool and drag it onto the layout (Figure 5.44). In this example we add the sub-summaries to the Trailing Grand Summary.
Figure 5.44. Drag the Part tool to the place in the layout where the sub-total field should appear.
3 .When the Part Definition dialog box appears, the "Sub-Summary when sorted by" radio button is selected by default. Select the source table for the field that contains your data from the drop-down list (Figure 5.45), then choose the field from the scrolling list (this example uses the Home State field). Click OK.
Figure 5.45. In the Part Definition dialog box, choose the field name from the scrolling list.
4 .The Sub-summary part is now in the layout, but the fields in the Trailing Grand Summary part have been pushed into it (Figure 5.46). Resize the Trailing Grand Summary part to accommodate the moved fields.
Figure 5.46. If necessary, adjust the size of the parts to accommodate the fields.
5 .Select the totals fields and their text labels. Hold the Control+Shift+Alt (Windows) or Shift+Option (Mac) keys and drag them back down where they belong (Figure 5.47).
Figure 5.47. Drag with special key combinations to duplicate the summary fields and position them in both the Sub-summary and Trailing Grand Summary parts.
This technique keeps the fields aligned, and duplicates them so they appear in two different layout parts. Although they are the same fields, in the Sub-summary part, they will display subtotals for each state. In the Trailing Grand Summary part, they will display totals for the entire report.6 .Edit any duplicated field labels or other text you need to change to match the corresponding parts.7 .Drag the Field tool into the Sub-summary part. When the Specify Field dialog box appears, choose the first field by which you want the sub-summaries to be sorted. In this example, we chose Home State (Figure 5.48).
Figure 5.48. Add to the Sub-summary part the field by which the summary fields will be sorted.
TipsTo add more subtotals, repeat steps 26, specifying different fields for the sort and duplicating the summary fields in the new Sub-summary parts.To make a report easier to read, you can add horizontal lines below the header text and the sub-summaries. Select a line weight (thickness), then click the Line tool. Hold down the Shift key (to keep the line straight) and draw the lines in the Header and Sub-summary parts (Figure 5.49). You can use the Control+Shift+Alt (Windows) or Shift+Option (Mac)-drag technique to duplicate the horizontal lines (or any other layout element).
Figure 5.49. The report will be easier to read with horizontal lines separating the sections.