Share via


Creating a Report

To begin, create a report that draws its information from the Xtreme sample database that ships with most versions of Crystal Reports.

Note

Xtreme.mdb is the sample database that is provided with most versions Crystal Reports. To locate xtreme.mdb on your hard drive for your version of Crystal Reports, see Location of Xtreme Sample Database. You need to connect to the database through its ODBC DSN entry. To learn the name of this entry for your version of Crystal Reports, see ODBC DSN Entry for Xtreme Sample Database.

To create a report with parameters

  1. In Solution Explorer, right-click the project name that is in bold type, point to Add, and then click Add New Item.

  2. In the Add New Item dialog box, in the Templates view, select the template named "Crystal Report."

  3. In the Name field, enter the name "Customers.rpt" and click Add.

> [!NOTE]
> <P>In Visual Studio .NET 2003, the button is named Open.</P>
  1. If you have not registered before, you are asked to register. To find out how to register, see Crystal Reports Product Keycode and Registration Number.

  2. In the Create New Crystal Report Document panel of the Crystal Reports Gallery dialog box, select Using a Report Wizard.

  3. In the Choose an Expert panel, select Standard, and then click OK.

  4. In the Available Data Sources panel of the Standard Report Creation Wizard window, expand the Create New Connection folder.

  5. From the subfolder that opens, expand the ODBC (RDO) folder.

  6. In the ODBC (RDO) window, select the correct ODBC DSN entry for your version of Crystal Reports as explained in ODBC DSN Entry for Xtreme Sample Database, and then click Finish.

The ODBC (RDO) folder expands and shows the Xtreme Sample Database.
  1. Expand the Tables node and select the Customer table.

  2. Double-click the Customer table to move the table into the Selected Tables panel, and then click Next.

  3. CTRL-click Country, Customer Name, Last Year's Sales, Region and City.

  4. Click the > symbol to move these fields into the Fields to Display panel, then click the Next button.

  5. In the Available Fields panel, under Report Fields, complete the following instructions:

1.  Select Country, click the \> symbol to move the field into the Group By panel.

2.  Select Region, click the \> symbol to move the field into the Group By panel.

3.  Click Next.
    
    Summarized fields are created for the Last Year's Sales field in the Country and Region groups.
  1. Click Finish.
The Customers report is created and loaded into the main window of Visual Studio.
  1. At the bottom of the window, click Main Report Preview.
The report is displayed hierarchically in levels that are sorted first by country and then by region. If you change the report to display as report parts, each level is displayed separately.

You are now ready to convert the report to display report parts.