Share via


Binding to Crystal Enterprise (Crystal Reports 10 and up)

Note

This page describes functionality that is not available in Crystal Reports for Visual Studio, but is available in one of the upgraded versions. For more information about Crystal Reports for Visual Studio, see What is Crystal Reports for Visual Studio? For more information about upgraded versions, see Upgrade Options.

Object Model

This report binding scenario uses ReportDocument (see Report Binding with ReportDocument Object Model).

Location of Reports

Reports are located in the managed RAS server (see Report Application Server (RAS)). Reports are wrapped in the ReportDocument class.

Crystal Services Overview

This report binding scenario applies to reports accessed from the Crystal Services server node in the Server Explorer.

Note

For an overview of Crystal Services, see Using Crystal Services.

This section examines the Crystal Enterprise sub node of Crystal Services, within Crystal Reports Developer.

[SERVERNAME]

  • Crystal Services
    • Crystal Enterprise

Description

The Crystal Enterprise sub node accesses and then displays reports that have been exposed by a managed RAS server within Crystal Enterprise.

The Crystal Services>Crystal Enterprise node exposes reports from the Crystal Enterprise, through the managed RAS server. The Crystal Enterprise node is functional, but if Crystal Enterprise has not been installed on the development machine, go to the Properties for this node and set the Crystal Enterprise server name on the network.

When you drag and drop a report from the Crystal Services>Crystal Enterprise node onto a Web or Windows form, an instance of ReportDocument is generated. The ReportDocument class works as a wrapper class. Its purpose is to wrap (represent) the report that is passed from the RAS server within Crystal Enterprise.

For a comparison table of Crystal Services, see one of the following:

For a summary of possible report binding solutions with Crystal Enterprise, see Summary of Recommended Scenarios.

Pros

  • Easy access: easy access to RAS reports within Crystal Enterprise from a Web application.
  • Extensive programmatic interaction: provides access to the powerful ReportDocument object model. The report wrapper class in this version is ReportDocument. This is the first version of Crystal Services that gives you access to the ReportDocument object model.

Cons

To use Crystal Services>Crystal Enterprise

  • Crystal Reports 10 or XI is installed and verified to be working.

Note

This procedure works only with a project that has been created from Project Setup. Project Setup contains specific namespace references and code configuration that is required for this procedure, and you will be unable to complete the procedure without that configuration. Therefore, before you begin this procedure, you must first follow the steps in Project Setup.

  1. In Visual Studio, open Server Explorer.

  2. Expand Crystal Services, and then expand Crystal Enterprise.

  3. Select a report from the Crystal Enterprise tree and drag it onto your form.

    At the bottom of the form in Design view, a reportDocument1 object appears.

    Note

    When a Crystal Enterprise report is placed onto your form, an instance of ReportDocument class is added to the Designer generated code region of your form.

    When classes that inherit from System.ComponentModel.Component (such as ReportDocument) are instantiated and configured within the Designer generated code region, an icon of this instantiated class appears at the bottom of the form in Design view.

  4. Switch to code view and open the Web or Windows Form Designer generated code region.

A ReportDocument class has been instantiated and configured within this region.
  1. Within the ConfigureCrystalReports() method (that you created in Project Setup), assign the ReportDocument instance to the ReportSource property of the CrystalReportViewer control.
``` vb
myCrystalReportViewer.ReportSource = reportDocument1
```

``` csharp
crystalReportViewer.ReportSource = reportDocument1;
```
  1. Build and run your Web project to view the report.

See Also