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.
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 unmanaged 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.
- Crystal Services
- Report Application Server
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 (see 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 (see unmanaged RAS) server.
For a comparison table of Crystal Services, see one of the following:
- CrystalReportViewer Binding Scenarios that Use Crystal Services
- ReportDocument Binding Scenarios that Use Crystal Services (VS .NET 2002 and 2003).
- Uncomplicated access: reports from the unmanaged RAS server (see unmanaged RAS) 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.
- Coding is less direct: not as direct as coding RAS reports with the ReportClientDocument object model. See Binding to an Unmanaged RAS Server Using ReportClientDocument.Open() Method.
- Crystal Reports 10 or greater is installed and verified to be working.
- The unmanaged RAS server (see unmanaged Report Application Server (RAS)) is installed and verified to be working.
To use Crystal Services>Report Application Server
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.
- In Visual Studio, open Server Explorer.
- Expand Crystal Services, and then expand Report Application Server.
- 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 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.
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.
- Switch to code view, and open the Web or Windows Form Designer generated code region.
Note A ReportDocument class has been instantiated and configured within this region.
- Within the ConfigureCrystalReports() method (that you created in Project Setup), assign the ReportDocument instance to the ReportSource property of the CrystalReportViewer control.[Visual Basic]
myCrystalReportViewer.ReportSource = reportDocument1[C#]
crystalReportViewer.ReportSource = reportDocument1;
- To view the report, build and run your project.