Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
81
Добавлен:
11.05.2015
Размер:
2.11 Mб
Скачать

In the VBScript code, the OpenReport call accesses the report file you specified in the design-time control, creating an instance of the Report object. A few lines below the OpenReport method, you will find the ReadRecords method. ReadRecords obtains data and generates the final report that will be displayed in the web browser. Using these two calls, you can modify the format and data displayed in the report.

As stated before, the VBScript code provided by the design-time control creates a Report object through which your reports can be manipulated. For instance, the following code sets a record selection formula for the report at runtime:

session(“oRpt”).RecordSelectionFormula = “{customer.Region} =’CA’"

Notice that the Report object is stored in the session object. For complete information on the session object, refer to the Microsoft documentation for Active Server Pages.

Session Timeout

By default, the session object provided by Visual InterDev for your project has a timeout value of 20 minutes. When designing web sites that use the Report Engine Automation Server and the Visual InterDev Design-time ActiveX Control, you will not be able to edit reports using Seagate Crystal Reports for 20 minutes after viewing them in a browser. Once your web site is designed and finished, this timeout period may be just fine. However, during the development process, you may want to alter the session timeout period.

The Session object has a Timeout property that determines how long the session waits before timing out. During development, add a line of code to your Active Server Pages to set the Timeout property to a much shorter timeout period, such as 1 minute. The following code demonstrates this:

session.Timeout = 1

Be sure to remove the line of code before making your web site available to other users.

Sample Web Site

Seagate Crystal Reports includes the Xtreme Mountain Bikes, Inc. sample web site (created using the Seagate Crystal Report Engine Automation Server and the Active Data Driver). This web site can be installed by selecting a Custom Installation when you install Seagate Crystal Reports, and then toggling the Xtreme Mountain Bike check box on under the Sample Files option in the Custom Installation Options dialog box. This site will be installed, by default, in the \Program Files\Seagate Software\Crystal Reports\sample\Xtreme\aspweb directory.

Once installed, this web site provides a complete example of an Internet or intranet site that generates and displays Inventory reports for a fictitious mountain bike distribution company. Simply log on as one of the company employees listed on the home page, and browse through the reports. Different options are available depending on which alias you use. The site also provides the option of viewing the source code for any Active Server Page.

Building Active Web Sites

48

Volume 1

 

3

Configuring the

 

Crystal Smart Viewers

What you will find in this chapter...

Note: This chapter contains information specific to the

Professional Edition of Seagate Crystal Reports.

Crystal Smart Viewer Overview, Page 50

...including an introduction and features, printing from the Smart Viewer, and using the Smart Viewer in applications.

Crystal Smart Viewer for HTML, Page 53

...including an introduction and limitations of HTML reports.

Crystal Smart Viewer for Java, Page 55

...including an introduction, adding a Smart Viewer with Java, and an example.

Crystal Smart Viewer for ActiveX, Page 57

...including an introduction, AuthentiCode certification, adding a Smart Viewer with ActiveX including the download, and an example.

Configuring the Crystal Smart Viewers

49

Соседние файлы в папке crystal