Access provides a number of wizards for creating quick
A few of them were discussed in Chapter 9. Sometimes a report isn't
as simple as a hard copy of your datayou can also print labels and
in a report. Don't worry, though, both reports are
simple to create as long as you let an Access wizard do the
Creating Label Reports
A label report is a little different from most reports. For
instance, you can print
tags, mailing labels, file labels, or
even inventory labels for storage. The uses are limited only by
your imaginationif the data's in a table, you can print a label for
In Chapter 13, you learned how to format controls and use the
Toolbox. You use the same techniques to add and modify controls in
reports. If you've already read Chapter 13, you should be able to
apply what you learned on your own. If you haven't, read the
appropriate sections in that chapter and work through the exercises
in a report instead of in a form.
Let's use the Chart Wizard to print a mailing label for each
catalog in your plants database. Do the following:
the Insert menu.
In the New Report
dialog box, select the
from the drop-down control, and then click
The wizard already
all the dimensions for a number of labels. Most of the time,
you can find your label listed among these options. For this
from the Unit of Measure and Label Type sections, respectively.
from the Filter by Manufacturer
drop-down control. Doing so limits the number of label
, as shown in Figure 14.6. Access has built-in
information for many common label types from various manufacturers.
If you don't find a suitable label, you can click the
button to enter your label's dimensions.
Figure 14.6. Choose a label by its product name or
In the next window,
you can specify fonts and other font attributes. Accept the default
options by clicking
without making any
Now you're ready to
list the fields that contain the data you want to print on labels.
You can also include literal
. You'll add the catalog
name and address fields as
in the Available Fields list to move it to the prototype label;
to move the insertion point to the
next line. Double-click
, and then type a
comma and space character. Next, double-click
add a space, and then double-click
to create the
prototype shown in Figure 14.7. Click
Figure 14.7. Add labels to the Prototype label.
labels by any field in the table. Select
default name to the label report in the final window. You can
change it, but don't. Click
to generate the
report shown in Figure 14.8.
Figure 14.8. The wizard generated this label report.
All that's left to do is to insert the label sheets and click
Displaying Charts in a Report
The Chart Wizard embeds a chart in a report. The chart is
actually an ActiveX controlAccess doesn't generate the chart.
Access uses Microsoft Graph to generate the chart, which offers 20
chart formats. The embedded chart lets you change its results by
to change the orientation. Or, you can
modify the default calculations.
The following are two ways to add a chart to a report:
Now, let's create a simple pie chart that denotes the plants
ordered from each catalog. Usually, you base a graph on a query
because the wizard can't handle more than one data source or
calculate the necessary values. Begin with a query that counts the
number of plants ordered from each catalog by following these
the Insert menu, select
from the drop-down
, and then click
fields to the
grid, in that order.
from the View menu on the Query Design
Change the Group By
aggregate in the CommonName column to
as shown in Figure 14.9. Save the query as
and close it.
Figure 14.9. Generating a chart from this query.
shortcut in the Database window and select
from the Insert menu and double-click
in the New Report dialog box.
In the wizard's first
window, move both fields to the Selected Fields list and then click
The next window
displays 20 chart formats. Select the
first option on the last row) and click
At this point, the
wizard generates a sample chart based on the data, as shown in
Figure 14.10. Don't be too
if the chart components don't
display the correct
, but do check the axis controls to
ensure the wizard is using the correct field(s). You want the pie
chart to show the plants by catalog, so the wizard made the right
choice by selecting the CountOfCommonName field. Don't change the
wizard's choices; just click
Figure 14.10. You can alter the wizard's charting choices.
In the final window,
name the report
without changing any other options. The results
are shown in Figure 14.11. You can see with a quick glance that
half the plants have come from Wildseed Farms.
Figure 14.11. The result chart shows the relationship, by
count, of the plants from each catalog.
You can click the Preview Chart button in the
to get a more accurate look at the chart. In addition, you can
change the default structure by rearranging the controls or
double-clicking a control and choosing a different mathematical
Now let's add a dynamic chart to the CatalogsAndPlants report
you created in Chapter 13. By
, we mean the
chart will reflect the values in each record. To create this chart,
perform the following steps:
Use the AutoReport: Tabular
Wizard to create a quick report on the Plantings table.
on the Print Preview toolbar to open the new
report in design view.
control in the Detail section, and press
to remove it from the report. You'll use that
spot to display the chart you're about to create.
from the Insert menu.
drag-and-drop method, insert a Chart control to fill the spot where
the Photo control was. When you release the mouse, the wizard
displays its first pane, which wants to know where the data for the
chart's going to come from. Select the
In the next pane,
identify the values you want to chart. In this case, move the
fields to the
Selected Fields list, and click
Cylinder Column Chart
the third option in the first
without making any changes in the next pane. You
don't need to alter any of the wizard's choices.
In the next pane, you
can relate chart values to report values. The chart automatically
the Bed fields. Add the
to the mix, as shown in Figure 14.12. Click
Figure 14.12. Relate chart values to report values.
In the final pane,
name the chart, such as
on the Print Preview toolbar to see the results
shown in Figure 14.13. As you can see, the axis values change from
record to record. As is, this particular chart might not be
effective, but you can see how easily you can chart individual
Figure 14.13. The axis values reflect each record.