Creating Reports

Reports are probably the most common way that users will view their data, and that's why one of the more robust features in Access is reporting. If you've used previous versions of Access, you'll notice that reporting has had a complete overhaul. Access 2007 has a slew of new reporting features that simplify common tasks to help decrease database development cost. There are two new view modes: an interactive report mode to allow users to use controls on the report and a layout mode to enable the report creator to see the data in the report while it is being created. Also, two new panes have been added: the Grouping and Sorting pane greatly improves grouping, sorting, and filtering tasks in a report, and the Design Task pane provides access to the updated Field List to allow working with more than just the fields in the record source of the form or report. In addition, there are many updates to previously existing features that were becoming archaic, such as the Auto Formats. Reporting in Access 2007 is a brand new experience for any user.

To create a new report, click on the Ribbon's Create tab of the Ribbon. As with forms, there are many options for predefined report layouts available, as show in Figure 1-11.

Figure 1-11

In the case of reports, you have the following options: Report, Labels, Blank Report, Report Wizard, and Report Design. As with forms, the Report and Label options are only available when Tables, Queries, Forms, and Reports are selected in the Navigation pane. If another open database object has focus instead of the Navigation pane, the report will be created based on the object with focus. Also similar to forms, certain design options are only available in Design View mode. For example, if you want to add controls to a report, the report must be open in Design mode. But, as mentioned before, the Layout view mode is extremely useful for viewing data, which helps refine report design and real estate efficiency.

Perhaps you want to create a report based on the Assets Created This Week query that you made earlier in the "Creating Queries" section of this chapter. Click on the Assets Created This Week query in the Navigation Pane to select it. Then, click the Report button in the Ribbon. A new report is created and opened in Layout View mode; it contains controls for all of the fields in the selected query. Because the report is in Layout mode, you are able to change the layout of the controls in it. All of the fields from the Assets Created This Week query are shown, so you may want to remove some of them, so that the data fits in the report all on one page. Go ahead and delete all of the fields in the report except Item, Category, Condition, and Purchase Price by clicking on the column and pressing the Delete key. Then, right-click on the Category field and choose the Group on Category option in the context menu. Notice that the Label and Grouping for the Category field is adjusted automatically (illustrating one of the many powerful grouping options available in Access 2007). Figure 1-12 shows what the report should look like with a few records of data added.

Figure 1-12

Using the quick report option can be one of the biggest time savers that Access 2007 offers. Often, reports (as well as forms) can be very time consuming in setting up and formatting to the desired settings. When used effectively, the quick report option eliminates much of the work to get the controls set on the report. Remember, a developer's time should be spent writing new code and designing systems, not fighting with the design of a report.

Now click on the Close button in the top-right corner of the report. Again, you are prompted to save, so type in the name New Assets Report and click OK. The new report is added to Navigation pane.

0 0

Post a comment