Enhance the report

Where you are

   Create the basic report

   Preview the report

   Save the report

   Set up the design environment

   Define sorting and grouping

>   Enhance the report

   Save the report as a PDF file

   Print the report

You can enhance reports in many ways. In this exercise you:

  • Rearrange controls

  • Add a title and date

  • Add page numbers

  • Add a count of the total number of contacts

Rearrange controls

To rearrange controls, you:

  • Put the job role into the group header and change its display font

  • Move the remaining columns to close the gap left by moving the column

This is what the Design view looks like when you have finished rearranging the controls.

About report bands

The design version of the report that you see in the Design view divides the report into bands of information.

The header band contains heading information and is located at the top of each page.

The detail band contains the retrieved data.

The summary band contains summary information that applies to the entire report and is located at the end of the report.

The footer band contains information to be located at the bottom of every page, such as a page number.

For groups, the group header band and group trailer band contain information for the group.

  1. Move the pointer to the gray bar entitled 1: Header group title until you see a double-pointed arrow

  2. Drag the band down about 4 to 6 grid dots.

    (To drag, press and hold the left mouse button, move the mouse, then release the mouse button.)

  3. Move the pointer to the title column and drag it into the band for the group header.

    Put it near the bottom of the band as shown.

  4. With the title column still selected, click B for bold and I for italic on the StyleBar.

    This makes the job role (title) stand out in the report.

  5. Look at the Preview view.

    You see the report and its data.

    Notice that the value of the title column appears only once for each group. This is because the title column is now located in the group header band.

    The Preview view is helpful for identifying problems. Notice that the header Job Role is still present even though there is no longer a column in the detail band. Next you delete the header.

  6. Click the text Job Role in the header band.

  7. Press the Delete key.

  8. Drag the First Name and Last Name text boxes in the header band to the right to fill the empty space.

  9. Drag the first_name and last_name columns in the detail band to the right to fill the empty space.

    You make one final visual improvement now by left-aligning the text in the column headers.

  10. Choose Edit>Select>Select Text from the menu bar.

    This selects all the headers. It might be difficult to see that they are selected because the band is so narrow.

  11. Click the left justification button on the StyleBar.

    If your headers are not already bold, click the Bold button.

    All the headers become left justified (and bold).

  12. Look at the Preview view.

Add a title and date

Now you add a title and date to the header band. They will be at the top of each page.

  1. Move the pointer to the gray bar marked Header and drag it down about 10 grid dots.

  2. Choose Edit>Select>Select Text from the menu bar (or use lasso selection).

    This selects all the headers.

  3. Drag all the headers down close to the gray band.

    This leaves room for the title.

  4. Click the Text button in the Objects drop-down toolbar in the PainterBar (or select Insert>Control>Text from the menu bar).

  5. Move the point of the pointer above the First Name box and down one grid dot from the top of the page.

  6. Click the left mouse button.

    This positions the text box for the title.

  7. Type My Contacts.

    Select 14 from the Size drop-down list on the Font tab in the Properties view to make the title bigger (enlarge the text box if necessary).

    The title is now enlarged.

  8. Select Insert>Control>Today( ) from the menu bar.

    Move the point of the pointer to the upper-left corner.

    Click.

    This places a computed field in the report. The computed field is for today's date.

  9. Look at the Preview view.

    Your report now has a title and today's date.

Add page numbers

Now you put page numbers in the footer band.

  1. Move the pointer to the gray bar marked Footer and drag it down about 4 grid dots.

    If necessary, use the scroll bar to make room at the bottom of the Design view.

    Dragging down the footer bar makes space for the page number in the footer band. The page number is another computed field.

  2. Select Insert>Control>Page n of n from the menu bar.

    In the footer band, move the pointer to the center and down 2 grid dots.

    Click.

    Select a different font size (10) in the Properties view, Font page.

    This places a computed field for page numbers.

  3. Look at the Preview view.

    Click the scroll bar until you move to the bottom of the page.

    You now have a page number on your report.

Add a count of the total number of contacts

Now you add a count of the total number of contacts you have to the end of the report. You put the information in the Summary band, which means it prints at the end of the report.

Like the date and page number, the count is a computed field, only this time, you create it yourself.

How to use lasso selection

Position the pointer, press and hold the left mouse button, and drag the lasso around everything you want to select. Then release the mouse button.

  1. Move the pointer to the gray strip marked Summary for the summary band and drag it down about 6 grid dots.

    This makes space for the total number of contacts, which is a computed field.

  2. Select Insert>Control>Computed Field from the menu bar.

    In the summary band, move the point of the pointer to the center and down 4 grid dots.

    Click.

    This sets the position for a computed field that you use for the total number of contacts. The Modify Expression dialog box displays.

  3. In the Functions box, click count(#x for all).

    Your dialog box should look like this. The placeholder for what to count is highlighted.

  4. In the Columns box, click last_name.

    This selects the last_name column to apply the count function to. You are going to count all the last names to find out how many contacts you have in the report.

  5. Click Verify.

    You should get the message box stating that your expression is valid.

  6. Click OK to close the message box.

    Click OK to complete the definition of the expression for the computed field.

    The computed field is in place.

  7. Select Insert>Control>Text from the menu bar.

    Position the pointer to the right of the computed field and click.

    Type contacts in all.

    Drag the text box to line it up with the computed field.

  8. Select the computed field and the text using lasso selection.

    On the Font page of the Properties view (or on the StyleBar), select 10 for a font size and click I for italic and B for bold.

  9. Look at the Preview view.

    Use the scroll bar until you see the end of your report.

    The summary band of your report now shows the total number of contacts in the report. The number you see may not be 61. The number depends on the contacts currently in your database.