Introduction to the Database Expert


Now that you've got a basic understanding of what database drivers are and an idea of which one you might use to access a particular data source, let's look at the user interface for selecting the data source for a report. Because this is the first step in the creation of a report, it is only natural that this is the first step in the Report Wizard. This is shown in Figure 1.6. The Database Expert is a tree control hosted inside the Report Wizard that enables you to identify the following:

  • Which Crystal Reports database driver you want to use

  • Which data source you want you use

  • Which database objects you want to use

Figure 1.6. The Database Expert provides access to the multitude of supported Crystal Reports data sources.


To open the Database Expert, select File, New and select the type of report you want to create. Selecting Blank Report opens the Database Expert on its own, whereas selecting any other report type opens the Database Expert as part one to a multipart wizard dialog. The Database Expert represents data source connections organized into a number of categories. The following sections describe each of these categories, whereas the Enterprise Repository is discussed in Chapter 18.

Creating a New Connection

To specify a new connection, expand the Create New Connection node in the Database Expert. As Figure 1.6 shows, you can select from a multitude of data sources in this interface. You will notice a node in this section for each of the drivers selected during the installation process.

Note

One node to take special note of is the More Data Sources node. When this is expanded, it lists all database drivers that are available but not installed. Crystal Reports supports install on-demand. This means that various features always appear as being available, even if they are not installed. When you expand one of the database driver's node selections under the More Data Sources node, that driver would be installed on demand. Then the next time the Database Expert is loaded, it would list that driver directly under the Create New Connection node.


Now that you understand which data sources are listed where, look at the process of creating a connection. To create a connection, follow these steps:

1.

Expand the node that corresponds to the appropriate database driver. An easy one to play with is the Xtreme sample database that comes with Crystal Reports XI. To create a connection to this database, expand the ODBC (RDO) node.

2.

Notice that when a node is expanded, a dialog is presented that allows for the specification of connection information. In the case of ODBC, the DSN is the only thing required. In this list of available DSNs, Xtreme Sample Database 11.5 should be visible. This is pre-installed with Crystal Reports. Select this and click Finish.

3.

Focus returns to the Database Expert, and there should be a node below the ODBC (RDO) node called Xtreme Sample Database 11.5. Below that node is the list of available tables, views, and stored procedures, as well as the Add Command option for adding a SQL command. (This will be discussed shortly.)

The Xtreme Sample Database could also have been used via the OLE DB or direct Access driver. Note that when prompted for connection information when using one of these drivers, the report developer is asked to provide different information. In the case of ODBC, a DSN needed to be selected, whereas with OLE DB, a provider would need to be specified.

Using Current Connections

The Current Connection node lists all database connections that are currently open. In other words, if a report is currently open or was recently open, that connection is listed under the Current Connections node. The first time the Crystal Reports Designer is opened, the Current Connection node is empty because no connections have been initiated. This is indicated by a "...no items found..." item shown when the Current Connections node is expanded. This is a quick way to select the same connection as another report currently open.

Using Favorite Connections

The Favorites node lists all connections that have been designated a favorite. This is analogous to favorites and bookmarks in a Web browser. If you have a certain database connection that is used often, adding it to the Favorites node makes it quick and easy to find in the future.

To accomplish this, create a connection to a database (you can use the Xtreme Sample Database to try this out), and select Add to Favorites when right-clicking on that connection. Be sure to right-click on the connection and not the driver or table name. Figure 1.7 illustrates the Xtreme Sample Database connection being added to a user's Favorites.

Figure 1.7. Add the Xtreme Sample Database ODBC connection to the Favorites node to locate it quickly.


Leveraging Recently Used Connections with the History Node

The History node is situated beneath the Favorites node in the Database Expert. It lists recent database connections that have been made. This is useful for quickly locating and using a connection that has been recently used, but not added to the Favorites list. The history list stores the last few connections. If you find yourself using connections from the History node frequently, it might be better to add the connection to your favorites list.




Crystal Reports XI(c) Official Guide
Crystal Reports XI Official Guide
ISBN: 0672329174
EAN: 2147483647
Year: N/A
Pages: 365

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net