Share via


Binding to Crystal Enterprise (Crystal Reports 9)

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. This scenario is valid only for Crystal Reports 9.

This binding scenario refers to legacy technology and is intended for users with an existing installation of Crystal Enterprise. Crystal Enterprise has been replaced by Crystal Reports Server and BusinessObjects Enterprise. For more information on Crystal Reports Server and BusinessObjects Enterprise, see Upgrade Options.

Object Model

This report binding scenario uses Report Binding with CrystalReportViewer Object Model.

Location of Reports

The report is located on the managed RAS server (see Report Application Server (RAS). The report is wrapped in the EnterpriseReportDocument 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 9.

[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.

When you drag and drop a report from the Crystal Services>Crystal Enterprise node onto a Web or Windows Form, an instance of EnterpriseReportDocument is generated. The EnterpriseReportDocument class functions as a wrapper class. Its purpose is to wrap (represent) the report passed out from the managed RAS.

Use of this binding scenario is replaced in Crystal Reports 10 with the following report binding scenario:

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

Pros

  • Uncomplicated access: easy access to the managed RAS reports from a Web or Windows application.

Cons

This model is not particularly effective for object model interaction:

  • EnterpriseReportDocument, the wrapper class, is used only to pass the report to and from the managed RAS server; it does not contain an object model.
  • Therefore, this binding scenario offers only the limited object model that is contained within the CrystalReportViewer. See Which Object Model Should I Use?.

For a superior solution for binding RAS reports, see Binding to Unmanaged RAS Using ReportDocument.Load() Method.

To use Crystal Services> Crystal Enterprise

  • Crystal Reports 9 is installed and verified to be working.

  • Crystal Enterprise is installed and verified to be working.

  • Crystal Enterprise SDK (including the .NET assemblies) is installed and verified to be working.

    Note

    If you have installed Crystal Enterprise on your development machine, the SDK is included with that installation.

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.

> [!NOTE]
> <P>The Crystal Enterprise node is functional only when Crystal Enterprise has been installed.</P>
  1. Select a report from the Crystal Enterprise tree and drag it onto your Web or Windows Form.
At the bottom of the form in Design view, an enterpriseReportDocument1 object appears.

When classes that inherit from System.ComponentModel.Component (such as EnterpriseReportDocument) 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.


> [!NOTE]
> <P>When a Crystal Enterprise report is placed onto your form, an instance of EnterpriseReportDocument class is added to the Designer generated code region.</P>
  1. Switch to Code view and open the Web or Windows Form Designer generated code region.
> [!NOTE]
> <P>An EnterpriseReportDocument class has been instantiated and configured within this region.</P>
  1. Within the ConfigureCrystalReports() method (that you have created in Project Setup), assign the EnterpriseReportDocument instance to the ReportSource property of the CrystalReportViewer control.

    myCrystalReportViewer.ReportSource = enterpriseReportDocument1
    
    crystalReportViewer.ReportSource = enterpriseReportDocument1;
    
  2. To view the report, build and run your project.