Share via


Creating a Report that Connects to the DataSet Schema

In the previous steps, you created a method that populates the DataSet schema with data from the database. In this section, you create a Crystal report that bases its data connectivity on the CustomerDataSetSchema schema.

  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 Visual Studio installed templates list, select Crystal Report.

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

If you have not registered before, you are asked to register. To learn how to register, see [Crystal Reports Product Keycode and Registration Number](ms225341\(v=vs.90\).md).
  1. In the Create New Crystal Report Document panel of the Crystal Reports Gallery dialog box, select Using a Report Wizard.

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

  3. In the Available Data Sources panel of the Standard Report Creation Wizard window, expand the Project Data folder.

  4. Expand the ADO.NET DataSets node.

  5. This step has two options: one for use with the strongly-typed DataSet class (that is available with Windows projects.) and one for use with the generic DataSet class (that is available with Web Sites).

    • For Windows projects that use the strongly-typed DataSet class, expand the CustomerDataSetSchema node. Expand the Tables node if there is one.

    • For Web Sites that use the generic DataSet class in, expand the DataSetConfiguration node.

      In the ADO.NET (XML) dialog box, select Use DataSet from Class. In the DataSet Names dialog box, select the CustomerDataSet property, and then click Finish.

  6. Select the Customer table node.

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

  8. Expand the Customer table, then CTRL-click Customer Name, Contact Title, Address1, Customer Las Name and City.

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

  10. In the Available Fields panel, under Report Fields, select Customer.City, click the > symbol to move the field into the Group By panel, and then click the Finish button.

    The Customer report is created, with data connectivity to the CustomerDataSetSchema (or, in a Visual Studio 2005 Web Site, to the CustomerDataSet property of the DataSetConfiguration class.)