Share via


Reporting off ADO.NET Datasets

Crystal Reports supports reports that access ADO.NET datasets.

An ADO.NET dataset object is a collection of dataset classes created in memory. You can create an ADO.NET dataset from various data sources (including Access, Oracle, and SQL Server databases) by using the Visual Studio ADO.NET Dataset Designer. The ADO.NET Dataset Designer shows a graphic view of the database with its tables, its fields, and their corresponding types. You can drag tables from the Server Explorer to a schema file in the Schema tab of the designer.

Generating ADO.NET Datasets

An ADO.NET dataset object provides a data description from which you can add tables to your Crystal report. The Database Expert in the embedded Crystal Reports Designer is used to add tables from the ADO.NET dataset object.

You can invoke the Database Expert when you are Accessing the Embedded Crystal Reports Designer with a Report Creation Wizard. Or, to access the Database Expert from a report that has already been set up with ADO.NET, right-click in the embedded Crystal Reports Designer, point to Database, and click Database Expert.

Viewing Reports using ADO.NET Datasets

A dataset object generated with the ADO.NET Dataset Designer contains only the data description, and not the actual data. Consequently, when working with a report connected to such a dataset object, you cannot browse field data in the embedded Crystal Reports Designer at design time.

To have the report display the actual data at runtime, you must first push the data into the dataset object using the ADO.NET Object Model, and then pass the populated dataset to the report engine using the Report Engine Object Model. You must also bind the report by report object in the corresponding source file for the Web or Windows form.

See Also