The document is archived and information here might be outdated

Tutorial: Connecting to Object Collections: Introduction

Visual Studio 2005

In this tutorial, you create a class that is the type for each object in the object collection. The class will represent stock market information. When you build your Crystal report, this Stock class is accessed from the report wizard much like a database table, but rather than add table columns as fields to display, you add class properties instead.

When the report is first displayed, the report is empty. The report design is complete, but no data is available to populate the report.

Then you create a method that instantiates an ArrayList and adds multiple Stock instances to the ArrayList instance. Each Stock instance has its properties set to unique values. The ArrayList instance is then returned from the method. You will add this information programmatically at design time, and again dynamically at run time.

The returned ArrayList, an object collection, is assigned to the SetDataSource property of the Crystal report. When the report is displayed, each object in the object collection provides one Detail row in the report.

To begin, you create the Stock class.

Continue to Creating the Stock Class.

See Also

Connecting to Object Collections | Tutorials and Sample Code | Tutorials' Sample Code Directory

© 2016 Microsoft