Crystal Reports Online Training

Learn Online, Anytime, Anywhere

Step-by-step online tutorials.

14.05 ReportDocument Object

The ReportDocument Object

The ReportDocument class is the base class for all reports. Its properties give an application the ability to thoroughly examine all the report objects. Many of these properties, but not all of them, have write capabilities so that you can modify their values.

Each report is a class that inherits from the ReportDocument class. Figure 14-1 shows the Object Browser window with the class for a blank report, CrystalReport1. You can see that ReportClass is the base class for the report. This class is derived from the ReportDocument class. The members listed to the right of the figure belong to the ReportDocument class.



Figure 14-1. Object Browser view of the ReportDocument class.

The ReportDocument class has seven other classes that it references. Figure 14-2 shows the ReportDocument object model. The class thoroughly exposes all the objects of a report. Since the coverage is so broad and hits many topics covered in this book, the relevant classes are covered in different chapters. This chapter gives you an overview of all the classes and goes into detail on the two generic classes SummaryInfo class and ReportOptions class.


Figure 14-2. The ReportDocument object model.

Every report in Visual Studio is saved as a class. Since it is a class, you have to declare an object variable and instantiate it. There are two ways to create this object variable. You can declare and instantiate it yourself, or you can add a ReportDocument component to your form. Both of these methods were discussed in Chapter 3. Either method gives you access to the properties of the object variable to manage the different collections.