Crystal Reports Online Training

Learn Online, Anytime, Anywhere

Step-by-step online tutorials.

17.07 Build the Report from the Data set

Build the Report Using the Dataset File

For a report to use the Push Model, it has to be designed using a dataset as the data source. The previous section showed three different ways to create the dataset schema file. The way that you created the dataset determines how it links to the report.

If you used the IDE to create a dataset, open the Database Expert, and expand the category ADO.NET Datasets. This lists all the datasets in the project. Expand the dataset you created to see the list of tables within it. Add the appropriate tables to the Selected Tables window on the right. Go to the Links tab to establish relationships between the tables.

If you created a dataset file manually, open the Database Expert and click on the category called “More Data Sources”. Under it you will see “ADO.NET (XML)”. Click on this and the dialog box in Figure 17-4 will open.



Figure 17-4. The ADO.NET (XML) dialog box.

This dialog box gives lets you browse the dataset files on your computer. It also has the option of letting you select a dataset that was created using the IDE. This is the same as the category “ADO.NET Datasets” which was discussed previously. These options are mutually exclusive and you can only use one of them. Choosing to enter the path of a dataset file lets you use the dataset file you just created or you can use a dataset file that already exists. This lets you re-use a dataset file that has been created for other projects or by other teams. If you want to use a dataset object that is part of your project, then select the checkbox “Use Visual Studio Data Class” and select the class name from the dropdown list.

After linking the report to a dataset, design the report as normal. When finished with the report layout, go to the next steps to populate the dataset.

Once the report is bound to a dataset file, the file is no longer used by the report. The schema information is saved within the report file. You can delete the dataset file after binding it and it will have no effect.