Reports

[ LiB ]  

Reports

A report is the database object that lets you present data in a meaningful way for sharing or even just storing. In this last section in this chapter, you'll learn how to

  • Build reports based on tables and queries.

  • Rearrange a report.

  • Group and summarize report data.

  • Preview and print reports.

Working with Reports

Reports are used to share data or even to just store hard copies of data.

Basing a Report on a Table or Query

Create and save a report based on a table, query.


Reports are based on a data source, either a table or a query. There are a number of ways to create a report:

  • Choose Report from the Insert menu.

  • Choose Report or AutoReport from the New Object button's drop-down list.

  • Click the Reports shortcut on the Object bar and double-click one of the shortcut items.

  • Click the Reports shortcut on the Objects bar and click New or Design on the Database Window toolbar.

If a report is based on data in more than one table, you must use a query that's based on the appropriate tables.


Arranging Fields and Label Headings

Change arrangement of data fields and headings within a report layout.


Figure 6.24 shows a report in design view, which is where you determine the report's layout. As you can see, there are a number of sections, but there can be more.

Figure 6.24. Arrange a report in design view.

Using the drag and drop methods , move controls (and labels) to other sections or to new positions within the same section.

Grouping Data by Fields

Group data under a specific heading (field) in a report in ascending , descending order.


When using a wizard to generate a report, you get the opportunity to specify whether the report is grouping data by specific fields. When creating a report from scratch, you can use the Sorting and Grouping feature.

With the report in design view, click the Sorting and Grouping tool. In the resulting dialog box, specify the fields you're grouping and specify a sort order if necessary, as shown in Figure 6.25. The grouped report reduces all matching values into one line and displays all the data within that group, as you can see in Figure 6.26.

Figure 6.25. Group a report by specific fields.


Figure 6.26. The grouped report has a group header and detail records for each group.

Summarizing Grouped Data

Present specific fields in a grouped report by sum, minimum, maximum, average, count, at appropriate break points.


Often, a grouped report summarizes the data in each group, like the one shown in Figure 6.27. Specifically, the report shows three levels of counting the number of orders: the number of orders per customer, the number of orders per month for each customer, and the total number of orders. To summarize the data, you simply add the appropriate domain expression to the appropriate area. A domain expression is an expression that evaluates an expression using a set of records:

  • Any expression in the detail section returns a value for each record.

  • An expression in a group's header or footer evaluates each group.

  • An expression in the report's header or footer evaluates all the data in the report.

Figure 6.27. Reports often summarize the data.

To create a grouped report, you can use the Report Wizard. To see this in action, follow these steps.

  1. Select the Reports shortcut in the Database window.

  2. Click the New toolbar button.

  3. In the New Report dialog box, select the Report Wizard and tell it the data should come from the Order Details table. Click OK.

  4. On the first page of the Report Wizard, select the OrderID and Quantity fields and click Next .

  5. On the next page of the Report Wizard, accept the default grouping by OrderID and click Next.

  6. On the next page of the Report Wizard, click the Summary Options button. This will open the Summary Options dialog box, shown in Figure 6.28.

    Figure 6.28. Choosing summary options for a report field.


  7. Check the boxes for the type of summary that you'd like to display on the report. Click OK.

  8. Click Finish to create the report.

Adding and Modifying Text in Headers and Footers

Add, modify text in headers, footers in a report.


Each report has two types of headers and footers. There's one at the report level: it is a good spot to put a report title, date, author, or report summary details. Another is at the page level, and it is a great place to display page numbers . (These are available to every report, unlike group headers and footers.) With the report in design view, choose Report Header/Footer or Page Header/Footer from the View menu to open the appropriate section of the report. Once the section is open, you simply insert controls as you normally would. For example, to add text to a header, drag a Label control to the header and then add the text to the Caption property of the label. To modify the text, edit the Caption property of the label.

Deleting a Report

Delete a report.


To delete a report, click the Reports shortcut on the Objects bar in the Database window. Then, select the report and press Delete. When prompted, either confirm or cancel the action.

Saving and Closing a Report

Save and close a report.


You save and close a report as you have all the other objects. To save a report, choose Save from the File menu, enter a name , and click OK. Or close the report and save the report when prompted.

To close a report, choose Close from the File menu. Or click the Close button on the report's title bar.

[ LiB ]  


ICDL Exam Cram 2
ICDL Exam Cram 2
ISBN: 0789730928
EAN: 2147483647
Year: 2006
Pages: 142

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net