Siêu thị PDFTải ngay đi em, trời tối mất

Thư viện tri thức trực tuyến

Kho tài liệu với 50,000+ tài liệu học thuật

© 2023 Siêu thị PDF - Kho tài liệu học thuật hàng đầu Việt Nam

Wrox Professional Crystal Reports for Visual Studio NET Second Edition phần 7 ppsx
MIỄN PHÍ
Số trang
38
Kích thước
2.0 MB
Định dạng
PDF
Lượt xem
1497

Wrox Professional Crystal Reports for Visual Studio NET Second Edition phần 7 ppsx

Nội dung xem thử

Mô tả chi tiết

06 557300 Ch06.qxd 3/24/04 9:36 AM Page 206

Chapter 6

need to set the ReportSource property in the load event (as shown subsequently using the URL from

our earlier example):

CrystalReportViewer1.ReportSource =

“http://localhost/Chapter06/inventory_reportService.asmx”

With the ReportSource property set, you can treat this just like any other report, setting properties for

the viewer and previewing the report, which is shown in Figure 6-11.

Figure 6-11

Internal Report Web Service

An internal Report Web Service refers to a Web service that has been added to your project as a refer￾ence. This method is sometimes also called the Proxy Method because every application that consumes a

Web service has to have a way to communicate with the service when the application is running. Adding

a reference to your Report Web Service creates a Proxy Class that in turn can communicate with the ser￾vice and create a local copy.

206

06 557300 Ch06.qxd 3/24/04 9:36 AM Page 207

Creating XML Report Web Services

To add the XML Report Web Service to your Web or Windows application, select Project → Add Web

Reference to open the dialog shown in Figure 6-12.

Figure 6-12

Using this dialog, enter the complete URL of your Report Web Service and click OK, and this will add

this reference to your project in the Project Explorer under Web References.

To bind an internal Report Web Service to the Windows Crystal Report Viewer, you will again need to

set the report source, only this time using the reference you have added instead of a URL. For example:

CrystalReportViewer1.ReportSource = New localhost.inventory_reportService()

From that point, all of the techniques you learned in Chapter 3, “Designing Reports,” and Chapter 4,

“Report Integration for Web-Based Applications,” can be applied to the Report Viewer to customize how

your report is presented.

Generic Report Web Service

To consume a report served through the generic Report Web Service, you will need to add the report

from the Server Explorer to your project. In the Server Explorer dialog, under the node marked Crystal

Services, navigate to the Server Files branch, where you should be able to see all of the available reports

that are within the Samples path we looked at earlier.

207

06 557300 Ch06.qxd 3/24/04 9:36 AM Page 208

Chapter 6

To add a report to your project, simply drag and drop the report onto a Windows or Web form. From

that point, you can add the appropriate Crystal Report Viewer to your form and bind the report to the

viewer, as shown here:

CrystalReportViewer1.ReportSource = ServerFileReport1

All of the properties, methods, and events available in the Crystal Report Viewer can be used from this

point.

Deployment Considerations

Report Web Services are deployed on a Web server and can be consumed by developers and users

within your organization or externally, based on where you deploy the service itself and what access

users have to the location you have selected.

When deploying Report Web Services (and Web applications in general), we have two deployment

options. The first is the easiest and involves copying your project to the Web server for deployment. To

use this method, you will need to open the project where your Report Web Service resides and select

Project → Copy Project, which will open the dialog shown in Figure 6-13.

Figure 6-13

You will need to specify a folder location for your project, as well as a Web access method. If you select

the FrontPage method, you must have the FrontPage Extensions installed and configured on the server

where you want to deploy your Report Web Service. Choose the File share method if you have direct

access to the server and just want to copy the files over.

At the bottom of the dialog, you will also need to select what files you want copied across to the Web

server. You have three choices:

208

Tải ngay đi em, còn do dự, trời tối mất!