November 2, 2005

Your First Report

Your first report

When crystal reports firsts opens up, you will see the following screen.

For this lesson, please select the Blank Report under new Reports.

Accessing the Data
Crystal Reports has a cool tool for managing all data access for you, it is called the Database Expert. The Database Experts allows you to view all datasources in one location.

I'm going to create a New Connection to my Northwind Database. Double Click on the ODBC(RDO) and the following window will appear.

This is a listing of all ODBC DSNs available to this machine and user. Select cnNothwind and hit next.

Enter the password of the reporter account and click Finish.



Now in the Database Expert, you will see the Northwind connection. If you click on it under dbo, the tables, views, and stored procedures associated with the Northwind database will appear. Highlight Views and click the plus sign in front of the views.

Select the Sales_Totals_by_Amount view and click the arrow to move it into Selected Tables. Click OK when completed.

The Database Expert gives you an opportunity to view current connections when access a previously written report. In addition you can use favorite connections, which keeps a history of your most frequently utilized database connection. Finally for recently utilized connections, check out the history folder in the Database Expert.

Now let's say, we needed a report where we had to check at the raw data, not the nice views. Go back into the Database Expert, and in the Northwind database select two tables, the Order_Details and Orders tables. Please click OK.

Suddenly instead of finishing the job, off the Database Expert appears with a new tab, Links. Links are how one table relates to another table.

Join Types are a strategy for relating the data in the tales so that the query results make sense.

  • An Inner join is the standard type of join. The result set from an Inner join includes all the records in which the linked field value in both tables is an exact match.
  • A Left Outer join includes all the records in which the linked field value in both tables is an exact match. It also includes a row for every record in the primary (left) table for which the linked field value has no match in the lookup table.
  • The result set from a Right Outer join includes all the records in which the linked field value in both tables is an exact match. It also includes a row for every record in the lookup (right) table for which the linked field value has no match in the primary table.
  • A Full Outer join includes all the records in which the linked field value in both tables is an exact match. It also includes a row for every record in the primary (left) table for which the linked field value has no match in the lookup table, and a row for every record in the lookup (right) table for which the linked field value has no match in the primary table. This is a bidirectional join resulting in the display of all records from both tables.

For this example, the Order table links to the Order Detail table. There maybe one Order with many detailed products associated with it. Since we have our primary keys and foreign keys defined within the database, these links have been created for us. Please Click OK.

Now notice in the field explorer, that the Order_Details and Orders tables are ready for you to utilize.



Posted by Elyse at November 2, 2005 7:56 AM
Comments
Post a comment









Remember personal info?