Share via


Binding to Report Application Server (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 on the unmanaged RAS server (see Report Application Server (RAS)). The report is 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 Report Application Server sub node of Crystal Services, within Crystal Reports Developer.

[SERVERNAME]

  • Crystal Services
    • Report Application Server

Description

The Report Application Server sub node accesses and then displays reports that have been exposed by an unmanaged RAS server. The RAS node is functional only when unmanaged RAS has been installed on your development machine.

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 unmanaged RAS server.

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

Pros

  • Uncomplicated access: reports from the unmanaged RAS server can be easily viewed in a tree view and dragged onto a Web Form.
  • 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>Report Application Server

  • Crystal Reports 10 or greater is installed and verified to be working.
  • The unmanaged RAS server 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 Report Application Server.

  3. Select a report from the Report Application Server tree and drag it onto your Web or Windows Form.

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


> [!NOTE]
> <P>When a Report Application Server report is placed onto your form, an instance of ReportDocument class is added to the Designer generated code region of your form.</P>


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.
  1. Switch to code view, and open the Web or Windows Form Designer generated code region.
> [!NOTE]
> <P>A ReportDocument class has been instantiated and configured within this region.</P>
  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. To view the report, build and run your project.

See Also