Share this Page URL

Chapter 6. What Every Developer Needs to... > Using Expressions to Enhance Your Re... - Pg. 226

What Every Developer Needs to Know About Reports 226 Inserting Page Breaks Page breaks can be set to occur before, within, or at the end of a section. The way you set each type of page break is quite different. To set a page break within a section, you must use the Page Break tool in the toolbox. Click the Page Break tool in the toolbox, and then click the report where you want the page break to occur. To set a page break before or after a section, set the Force New Page property of the section to Before Section, After Section, or Before & After. The Force New Page property applies to Group Headers, Group Footers, and the report's Detail sec- tion. CAUTION Be careful not to place a page break within a control on the report. The page break will occur in the middle of the control's data. Unbound, Bound, and Calculated Controls You can place three types of controls on a report: Unbound, Bound, and Calculated. Unbound controls, such as logos placed on reports, aren't tied to data. Bound controls are tied to data within a field of the table or query underlying the report. Calculated controls contain valid expressions; they can hold anything from a page number to a sophisticated financial calculation. Most complex reports have a rich combination of Unbound, Bound, and Calculated controls. Using Expressions to Enhance Your Reports Calculated controls use expressions as their control sources. To create a Calculated control, you must first add an Unbound control to the report. You must precede expressions with an equal sign (=); an example of a report expression is =Sum([BillableHours]). This expression, if placed in the Report Footer, totals the contents of the BillableHours control for all detail records in the report. You can build an expression by typing it directly into the control source or by using the Expression Builder, covered in Chapter 5. Building Reports Based on More Than One Table The majority of reports you create will probably be based on data from more than one table. This is because a properly normalized database usually requires that you bring table data back together to give your users valuable information. For example, a report that combines data from a Custom- ers table, an Orders table, an Order Details table, and a Product table can supply the fol- lowing information: · Customer information :company name and address · Order information :order date and shipping method · Order detail information :quantity ordered and price · Product table :product description You can base a multitable report directly on the tables whose data it displays, or on a query that has already joined the tables, providing a flat table structure. Creating One-to-Many Reports You can create one-to-many reports by using a Report Wizard, or you can build the report from scratch. Different situations require different techniques, some of which are covered in the following sections.