[ Pobierz całość w formacie PDF ]
.The page header section shown in Figure 8-18 also has lines above and below the labelcontrols.Each of the report s label controls is separate and each can be moved or sizedindividually.You can also change special effects (such as color, shading, borders, linethickness, font type, and font size) for each text control.Both the page header and page footer sections can be set to one of four settings (this settingcan be found in the Report s properties, not the section properties):&' All Pages.Both the page header and page footer print on every page.&' Not with Report Header.Neither the page header nor footer prints on a page withthe report header.&' Not with Report Footer.The page header does not print with the report footer.Thereport footer prints on a new page.&' Not with Report Header/Footer.Neither the page header nor the footer prints on apage with the report header or footer. 190 Part I &' Getting Functional with Office 2003Group headerGroup headers sections normally display the name of the group.Access knows when all therecords in a group have been displayed in a detail section when the group name changes.Inthis example, the detail records are about products and their costs and profits.The groupheader field control chrCategory tells you that these products are of a specific category type.Group header sections immediately precede detail sections.It is possible to have multiple levels of group headers and footers.In this report, forexample, the data is only for categories.However, in some reports you might have groups ofinformation with date values.You could group your sections by year or month and year, andwithin those sections by another group such as category.To set group-level properties such as Group On, Group Interval, Keep Together, or somethingNoteother than the default, you must first set the Group Header and Group Footer property (or both)to Yes for the selected field or expression.You will learn about these later in the chapter.Detail sectionThe detail section processes every record in the data and is where each value is printed.Thedetail section frequently contains a calculated field such as profit that is the result of amathematical expression.In this example, the detail section simply displays informationfrom the tblProduct table except for the last control.The profit is calculated by subtractingthe value of curCost from the value of curSalePrice.You can tell Access whether you want to display a section in the report by changing the section sTipVisible property in the Report Design window.Turning off the display of the detail section (or byexcluding selected group sections) displays a summary report with no detail or with only certaingroups displayed.Group footerYou use the group footer section to calculate summaries for all the detail records in a group.In the Products Summary report, the expression =Sum([curSalePrice] - [curCost]) adds allthe calculations of Sale Price  Cost for a specific category.In the Minivans group, thisexpression sums the seven records.This type of field is automatically reset to 0 every timethe group changes.TipYou can change the way summaries are calculated by changing the Running Sum property ofthe field box in the Report Design window.Page footerThe page footer section usually contains page numbers or control totals.In very largereports, you may want page totals as well as group totals (such as when you have multiplepages of detail records with no summaries).For the Products Summary Report, the page Chapter 8 &' Understanding and Creating Access Reports 191number is printed by combining the text Page, and built-in page number controls show Pagex of y where x is the current page number and y is the total number of pages in the report.Atext box control with the following expression in the Control Source property can be used todisplay page number information.= Page:  & [Page] &  of  & [Pages](which keeps track of the page number in the report).You can also print the date and the time printed.Figures 8-18 and 8-19 show the date printedin the Page Footer section as well as the page numbers.Report footerThe report footer section is printed once at the end of the report after all the detail recordsand group footer sections are printed.Report footers typically display grand totals or otherstatistics (such as averages or percentages) for the entire report.The report footer for theProducts Summary report uses the expression =Sum with each of the numeric fields to sumthe amounts.NoteWhen there is a report footer, the page footer section is printed after the report footer.The Report Writer in Access is a two-pass report writer, capable of preprocessing all recordsto calculate the totals (such as percentages) needed for statistical reporting.This capabilityenables you to create expressions that calculate percentages as Access processes thoserecords that require foreknowledge of the grand total.Creating a New ReportFundamental to all reports is the concept that a report is another way to view the recordsin one or more tables.It is important to understand that a report is bound to either a singletable or a query that brings together data from one or more tables.When you create areport, you must select which fields from the query or table you want to see in your report.Unless you want to view all the records from a single table, bind your report to a query.Even if you are accessing data from a single table, using a query lets you create yourreport on the basis of a particular search criterion and sorting order.If you want to accessdata from multiple tables, you have almost no choice but to bind your report to a query.Inthe examples in this chapter, all the reports are bound to a query (even though it ispossible to bind a report to a table).Access lets you create a report without first binding it to a table or query, but you will have nofields on the report.This capability can be used to work out page templates with common textNoteheaders or footers such as page numbering or the date and time, which can serve as models forother reports.You can add fields later by changing the underlying control source of the report. 192 Part I &' Getting Functional with Office 2003Throughout this chapter, you learn the tasks necessary to create the Products DisplayReport (the partial first page is shown in Figure 8-19).In this chapter, you design the basicreport, assemble the data, and place the data in the proper positions.You can learn moreabout enhancing your reports by adding lines, boxes, and shading so that certain areasstand out in Wiley s Access 2003 Bible, chapter 14.As with almost every task in Access, there are many ways to create a report withoutwizards [ Pobierz całość w formacie PDF ]
  • zanotowane.pl
  • doc.pisz.pl
  • pdf.pisz.pl
  • odbijak.htw.pl