Crystal Reports Online Training

Learn Online, Anytime, Anywhere

Step-by-step online tutorials.

2.02 Creating a New Report Class

Creating a New Report Class

To create and print a report, you need to create a new report class for your project. Once the class is created, you can modify it using the report designer and then call it from your application.

Creating a new report class is done two different ways. The first is to select the menu options Project | Add New Component. The other way is to right-click on your project name in the Solutions Explorer window and select Add | Add New Component. Both of these methods open the Add New Item dialog. Scroll down near the bottom to select Crystal Report, type in a report name, and click Open.

The Crystal Report Gallery dialog box opens (see Figure 2-1). You are given the option of using the report expert, creating a blank report, or creating a report using an existing report. If you choose the Report expert option, you can tell it the type of report expert to use in the list box below the options. If you choose to start with a blank report, the gallery goes away and a new report is created. This report gives you the five basic report sections and each is empty. Add report objects to the proper sections and format them to build your report.

You can also create a new report based off an existing report by selecting Project | Add Existing Item. This skips the Gallery dialog box and immediately shows you the Open File dialog box. A copy of the report is saved in the same folder as your application. All changes are made to the local copy and do not effect the original report.



Figure 2-1. The Report Gallery dialog box.