Mastering Business Analysis with Crystal Reports 9 (Wordware Applications Library)

Before creating any report, you'll need to select a data source. For the examples in this book, you'll use the sample xtreme.mdb data-base provided with Crystal Reports. Go ahead and connect to this database (as you did in the last chapter). You should see your connection display in the Database Expert dialog box.

Note

As mentioned in the last chapter, Crystal Reports allows you to connect to the same database using different methods. Check with your system administrator for your company's preferred method of database connection.

Selecting Database Tables for Your Report

Once you've connected to the xtreme.mdb file, click on the data-base's node. Notice that the database contains the following three nodes: Tables, Views, and Stored Procedures, as shown in Figure 3-1. These nodes represent the database's data structures.

Figure 3-1: Viewing the data structures of your database

You learned about tables in Chapter 1. For most of your reporting needs, you'll find yourself working with tables more than any other database structure. However, it never hurts to familiarize yourself with these other database options available for reporting:

For now, double-click the Tables node. You'll notice a list of tables display, as shown in Figure 3-2.

Figure 3-2: The Tables node displays all tables within a database.

Once you've successfully connected to your database, you can choose one or more database tables you wish to include within your report. To add a table to your report, perform the following steps:

  1. Select the table you wish to include within your report.

    For this report, select the Customer table.

  2. Press the Add button (>).

    You'll see the Customer table move to the Selected Tables list box.

  3. Press the OK button.

    The Database Expert dialog box closes, and the Report Design area displays.

If you choose more than one table, you'll see a linking screen display. Using two or more tables within a report requires successfully linking the two tables together. Linking multiple tables is covered in Chapter 6.

Tip

You don't have to select all tables needed within a report right away. Once in the Report Design area, you can always access the Database Expert again and add tables as needed. To access the Database Expert within the Report Design area, select Database, Database Expert from the menu bar.

Категории