Modifying a Report

Modifying a Report

You can use the Report Wizard to get a quick start on a report, but you will usually want to use Design view to refine the report and add special touches. Refining a report is an iterative process: you switch back and forth between Design view and Print Preview to evaluate each change you make and to plan the next change.

In this exercise, you’ll work with the Alphabetical List of Products report from the GardenCo database.

USE the GardenCo database in the practice file folder for this topic. This practice file is located in the My DocumentsMicrosoft PressAccess 2003 SBSReportsModify folder and can also be accessed by clicking Start/All Programs/Microsoft Press/Access 2003 Step by Step.

OPEN the GardenCo database and acknowledge the safety warning, if necessary.

  1. On the Objects bar, click Reports.

  2. Click Alphabetical List of Products, and then click the Preview button to open the report in Print Preview.

    Modifying a Report
    Modifying a Report
  3. Enlarge the window, and then move the pointer over the page. The pointer changes to a magnifying glass with a plus sign in it to indicate that you can zoom in on the page. Click once to zoom in, and notice some of the following problems with the report design:

    • There is no date below the title.

    • Some horizontal lines need to be removed or added.

    • There is some extraneous text.

    • Labels and text boxes need to be rearranged.

    • The list breaks in mid-group.

    • There are a number of general formatting issues.

  4. Click the View button to view the report in Design view.

    Modifying a Report
    Modifying a Report
  5. Point to the top of the Page Header selector. When the pointer changes to a two-headed vertical arrow, drag the selector down about a quarter inch.

    Tip

    There are rulers above and to the left of the form to help you judge the size of the printed report. You can toggle these and the grid dots on and off by right-clicking the report and clicking Ruler or Grid.

    You should now be able to see the double lines below the title. (The horizontal lines inserted by the wizard actually consist of sets of two lines.)

  6. In the Report Header section, click one of the lines above the title, and press . Then repeat this step to delete the other line above the title and one of the lines below it.

    Troubleshooting

    Small black handles indicate your selection.

  7. Click the Toolbox button to open it, if necessary.

    Troubleshooting
  8. Click the Text Box control in the toolbox, and then click in the blank area at the right end of the Report Header section to insert a text box and its label.

    Troubleshooting
  9. Click the new label, and delete it.

  10. Drag the text box to just below the title, and align it with the left edge. With the text box still selected, press the key to display the Properties dialog box.

  11. On the Data tab, click Control Source, and type the following:

    =Format(Date(), "dd mmm, yyyy")

  12. Press .

    A custom date format is created. The Date() function returns the current date and time. The Format() function determines the manner in which the date and time are displayed. Each time you preview or print the report, this expression will insert the current date in the text box, and format it in this fashion: 17 Feb, 2003.

  13. Close the Properties dialog box.

    Tip

    You can quickly insert a text box that displays the date and/or time in one of several standard formats. In Design view, on the Insert menu, click Date and Time. A dialog box appears in which you can specify the format. When you click OK, Access inserts a text box in the Header section if it exists, or in the Detail section if it doesn’t. You can then move the text box to where you want it. For detailed information about date formats, search for date formats in Access online Help.

  14. In the ProductName Header section, delete all the bold lines above and below the labels. (There are two sets of two.)

  15. Delete the Product Name by 1st label, and drag the text box to the left edge of the section.

  16. In the Page Footer section, click the text box containing =Now(), and click .

  17. Drag a rectangle around all the labels in the ProductName Header section and the text boxes in the Detail section to select them.

    Selection handles appear around the borders of all the controls, and you can now move them as a group.

  18. Move the controls to the left until the left edge of Product Name lines up with the half-inch mark on the ruler at the top of the window.

    Tip
  19. Save your changes, and then switch to Print Preview.

    The report is displayed in Print Preview. You still need to add a thin line at the bottom of each group, and you need to prevent the groups from breaking across pages.

  20. Switch back to Design view, and then click the Sorting and Grouping button on the toolbar.

    Tip
    Tip

    The Sorting and Grouping dialog box appears. The top field, which should already be selected, has an icon in its row selector indicating that it is the field on which records are grouped. Because Group Header is set to Yes and Group Footer is set to No in the Group Properties area, a ProductName header is displayed in your report, but a ProductName footer isn’t.

  21. In the Group Properties area, double-click Group Footer to change it to Yes.

    A ProductName Footer section selector appears in the Design view window, above the Page Footer section.

  22. Change the Keep Together setting to Whole Group, and close the Sorting and Grouping dialog box.

  23. Click the Line control in the toolbox, and then click near the top of the ProductName Footer section to insert a short horizontal line.

    Tip
  24. Press to display the Properties dialog box, if necessary, and then click the Format tab.

  25. Type 0 as the Left property, and 6.5 as the Width property.

  26. Close the Properties dialog box, save your changes, and then switch to Print Preview to see how the report looks.

    The report is displayed in Print Preview. You still need to remove the set of lines above the page number and realign the columns.

  27. Switch to Design view, and delete the two lines at the top of the Page Footer section.

    If you can’t see the lines, drag a rectangle starting below the lines and move upward to select them. This will select them, even if you can’t see them.

  28. In the ProductName Header and Detail sections, select the label and text box for Units In Stock, and drag them to the right until their right edges touch the right edge of the background grid.

  29. In the same two sections, move the label and text box for Quantity Per Unit to the right until the left edge is at about 3.75 inches.

  30. Lengthen the label and text box for CategoryName and the text box for QuantityPerUnit.

    Tip

    To make changes to two or more controls, you can drag a rectangle to group and select them, and then drag a handle on any selected control to change all of them the same way.

    Tip
  31. Save your changes, and preview the report.

  32. Close the report.

CLOSE the GardenCo database.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset