- •Seagate Crystal Web Reports Server Overview
- •What is the Web Reports Server?
- •Who should use the Web Reports Server?
- •Web Reports Server Features
- •New Features in Version 7
- •The Web Reports Server vs. Active Server Pages
- •Sample Web Sites
- •Implementing the Web Reports Server
- •Choosing a Web Reports Server
- •System Requirements
- •Installing the Web Reports Server
- •Confirming Correct Installation
- •Virtual Directories
- •Creating a Web Site
- •For More Information
- •Crystal Web Reports Server Administration
- •The Web Reports Server Configuration Application
- •Page Server Tab
- •Image Server Tab
- •Report Exporting Tab
- •Server Mappings Tab
- •Report Viewing Tab
- •The Page Server and the Image Server
- •Smart Navigation
- •Drilling Down on Data
- •Database Location
- •Web Reports Server Commands
- •The Crystal Web Reports Server Command Expert
- •Constructing Report Requests
- •Changing Selection Formulas in Web Reports
- •SQL and ODBC Data Sources
- •SQL Stored Procedures and Parameter Fields
- •Report Exporting
- •Refreshing Web Report Data
- •Web Reports Server Architecture
- •The Web Reports Server Extension
- •The Seagate Crystal Web Image Server
- •The Seagate Crystal Web Page Server
- •Report Processing
- •Job Manager Overview
- •Seagate Crystal Report Engine Automation Server
- •Visual InterDev Design-time ActiveX Control
- •Using an Existing Report
- •Building a Report at Runtime
- •Editing Active Server Pages
- •Customizing the Crystal Smart Viewer
- •Modifying the Report
- •Session Timeout
- •Sample Web Site
- •Crystal Smart Viewer Overview
- •Features of the Crystal Smart Viewers
- •Printing from the Crystal Smart Viewers
- •Using Crystal Smart Viewers in Applications
- •Crystal Smart Viewer for HTML
- •Limitations of HTML Reports
- •Crystal Smart Viewer for Java
- •Adding the Viewer to a Web Page
- •Crystal Smart Viewer for ActiveX
- •AuthentiCode Certification
- •Adding the Viewer to a Web Page
- •Downloading the Viewer from the Server
- •ActiveX Viewer Example
- •Introduction to the Crystal Report Engine
- •Before using the Crystal Report Engine in your application
- •Using the Crystal Report Engine
- •Crystal Report Engine API
- •Declarations for the Crystal Report Engine API (REAPI)
- •Using the Crystal Report Engine API
- •The Print-Only Link
- •The Custom-Print Link
- •Working with Parameter Values and Ranges
- •Working with section codes
- •Crystal Report Engine API variable length strings
- •Crystal Report Engine API structures
- •Working with subreports
- •Changing report formats
- •Exporting reports
- •PEExportTo Overview
- •PEExportOptions Structure
- •Considerations when using the export functions
- •Handling Preview Window Events
- •Distributing Crystal Report Engine Applications
- •Additional Sources of Information
- •Using the Crystal Report Engine API in Visual Basic
- •When to Open/Close the Crystal Report Engine
- •Embedded Quotes in Visual Basic Calls to the Crystal Report Engine
- •Passing Dates/Date Ranges in Visual Basic using the Crystal Report Engine API Calls
- •Identifying String Issues in Visual Basic Links to the Crystal Report Engine
- •Hard-coded Nulls in Visual Basic User Defined Types
- •Visual Basic Wrapper DLL
- •Crystal ActiveX Controls
- •Adding the ActiveX Control to your Project
- •Using the ActiveX Controls
- •Upgrading from the Crystal Custom Control
- •Crystal Report Engine Automation Server
- •Adding the Automation Server to your Visual Basic Project
- •Using the Automation Server in Visual Basic
- •Object Name Conflicts
- •Viewing the Crystal Report Engine Object Library
- •Handling Preview Window Events
- •Distributing the Automation Server with Visual Basic Applications
- •Sample Applications
- •Active Data Driver
- •Data Definition Files
- •Using the Active Data Driver
- •Creating Data Definition Files
- •Using ActiveX Data Sources at Design Time
- •Crystal Data Object
- •CDO vs. the Crystal Data Source Type Library
- •Using the Crystal Data Object
- •Crystal Data Object Model
- •Crystal Data Source Type Library
- •Creating a new project and class
- •Adding the type library
- •Implementing the functions
- •Passing the CRDataSource object to the Active Data Driver
- •Crystal Data Source Projects
- •Grid Controls and the Crystal Report Engine
- •Bound Report Driver and Bound Report Files
- •Crystal ActiveX Control Properties
- •Creating a Bound Report using the Crystal ActiveX Control
- •Creating a Formatted Bound Report
- •Creating a Formatted Bound Report at Runtime
- •Sample Application
- •ActiveX designers
- •The Report Designer Component vs. Seagate Crystal Reports
- •Data Access
- •No drag and drop between reports – use copy and paste
- •Conditional Formatting
- •Preview Window
- •Pictures
- •Guidelines
- •Subreports
- •The dual formula environment
- •Application Distribution
- •Installing the Report Designer Component
- •System Requirements
- •Installation
- •Using the Seagate Crystal Report Designer Component
- •Adding the Report Designer Component to a Project
- •Selecting Data
- •The Report Expert
- •Adding the Smart Viewer
- •Running the Application
- •CrystalReport1 - The Report Designer Component
- •CRViewer1 - The Smart Viewer Control
- •The Code
- •Report Packages
- •Working with data
- •ADO and OLEDB
- •Connecting to data with ADO
- •Connecting to data with RDO
- •Connecting to data with DAO
- •Data Environments
- •Data Definition Files
- •Report Templates
- •ODBC, SQL, and PC data sources
- •Report Designer Overview
- •Introduction to the Report Designer Component
- •Report Designer Architecture
- •Report Designer Object Model Programming
- •Report Designer Object Model Introduction
- •Obtaining a Report object
- •Displaying the report in the Smart Viewer
- •Setting a new data source for the report
- •Using ReadRecords
- •Passing fields in the correct order
- •Working with secure data in reports
- •Handling the Format event
- •Changing the contents of a Text object
- •Changing OLE object images
- •Working with Sections
- •Working with the ReportObjects collection
- •Working with the FieldObject object
- •Working with the SubreportObject object
- •Working with the Database and DatabaseTables objects
- •Working with the CrossTabObject object
- •Exporting a report
- •The Application object
- •Report events
- •Microsoft Access Sessions
- •Programmatic ID
- •Report Distribution Considerations
- •Distributing reports as part of the application
- •Saving reports as external files
- •Saving data with reports
- •VCL Component Overview
- •Installation
- •Delphi 2
- •Delphi 3 & 4
- •C++ Builder 3
- •Programming Overview
- •Introduction to the Object Inspector
- •Changing Properties in the Object Inspector
- •Changing Properties at Runtime
- •Delphi Programmers introduction to the SCR Print Engine
- •Dealing with SubClass Objects
- •Consistent Code
- •Using the Retrieve method
- •Working with subreports
- •Other Guidelines
- •Programming Tips
- •Always Set ReportName First
- •Discard Saved Data
- •Verify Database
- •Connecting to SQL Servers
- •Changing Tables & Formulas
- •Changing Groups & Summary fields
- •Using the Send methods
- •Using the JobNumber property
- •TCrpeString
- •Introduction
- •TCrpeString VCL Properties
- •Using the TCrpeString
- •Using Variables with Formulas
- •Introduction
- •Examples
- •About Section Names
- •Introduction
- •Methodology
- •StrToSectionCode
- •C++ Builder 3
- •Introduction
- •Code Syntax
- •Additional Code Examples
- •Known Problems
- •Retrieving ParamFields from a Subreport
- •DialogParent and Temporary Forms
- •Technical Support
Seagate Crystal Report Engine Automation Server
This topic is only supported by the Professional Edition of Seagate Crystal Reports.
The Seagate Crystal Report Engine Automation Server allows you to build powerful active web sites with any web server that supports ActiveX and Active Server Pages. This section demonstrates how to bring the full power of the Report Engine Automation Server to your Microsoft Internet Information Server (IIS) web sites.
Although the Seagate Crystal Web Reports Server provides many features for viewing reports from a web browser, the ability to format and select data is limited to a few simple commands. The Seagate Crystal Report Engine Automation Server, on the other hand, gives you all the power of the Seagate Crystal Report Engine.
For adding the Report Engine Automation Server to a web site, Seagate Crystal Reports provides the Visual InterDev Design-time ActiveX Control for use with Microsoft Visual InterDev. In this chapter, you will learn how to use the Visual InterDev Design-time ActiveX Control to automatically set up VBScript code in your Active Server Pages that uses the Report Engine Automation Server and the Active Data Driver.
NOTE: For additional information on the objects, methods, and properties provided by the Seagate Crystal Report Engine Automation Serve, Please see Crystal Report Engine Object Model for the Automation Server, Volume 3, Chapter 6.
Visual InterDev Design-time ActiveX Control
When you install Seagate Crystal Reports, if you select the Custom installation option and choose to install the Development tools, the Crystal Report Engine Automation Server and the Visual InterDev Design-time ActiveX Control will be installed and registered on your system. However, to successfully use these tools with a web site, you must also install them on your web server system.
When used from within Active Server Pages, the Crystal Report Engine Automation Server dynamically produces reports that are displayed in a web browser by using one of the Crystal Smart Viewers (see Configuring the Crystal Smart Viewers, Page 49). Using the powerful server-side scripting capabilities of Active Server Pages, you can design useful web-based interfaces and query tools for accessing reports over an intranet or extranet.
The Visual InterDev Design-time ActiveX Control has been designed specifically for Microsoft Visual InterDev. With the Design-time ActiveX Control, you can quickly and easily add server-side VBScript code to your Active Server Pages. The design-time control lets you select an existing report, or build a dynamic report at runtime that accesses data from an ActiveX data source, such as ActiveX Data Objects (ADO).
This chapter takes you through the steps of building a basic web site inside Visual InterDev using the Designtime ActiveX control, the Report Engine Automation Server, and ADO. Use the examples in this chapter as a basis for building your own web sites. Most of the steps illustrated will work in either version 1.0 or 6.0 of Visual InterDev. Differences between the two versions, though, will be indicated with notes.
Building Active Web Sites |
44 |
The following topics are discussed in this section.
Using an Existing Report, Page 45
Building a Report at Runtime, Page 46
Using an Existing Report
This section demonstrates how to add code to your Active Server Pages with the Visual InterDev Design-time ActiveX Control, in order to display an existing report in the Crystal Smart Viewer for ActiveX.
Use the following steps when working in version 1.0 of Visual InterDev:
1With a web project open in Visual InterDev, add a new Active Server Page. For more information on opening web projects and adding ASP pages, refer to the Visual InterDev documentation. For this example, the web project will be named MySite and the new ASP page will be named ReportPage.asp.
2Choose the ACTIVEX CONTROL command from the Insert|Into HTML menu. The Insert ActiveX Control dialog box appears.
3Click the Design-Time Tab to display design-time ActiveX controls that are registered on your system.
4Highlight the CrystalReport.DTC design-time control, and click OK.
5Close the Properties dialog box if it appears. The Visual InterDev Design-time ActiveX Control appears in the Microsoft Developer Studio window.
6Toggle the Use Existing Report check box on, if it is not on already. This disables most of the controls in the design-time control. If you have not added a data connection to your web project, this check box will automatically be toggled on and disabled.
7Click Browse to select the report you want displayed in your web site. The Select Report Name dialog box appears.
8Use this dialog box to locate and select the desired report. Enter a standard DOS path to the report. Do not use a URL address or a UNC path. Click Open when finished. The selected report appears in the Report Name text box of the design-time control.
9From the Viewer drop-down list, select the Crystal Smart Viewer you want to use to display the report.
10 When finished, close the window that contains the Visual InterDev Design-time ActiveX Control.
Once you close the design-time control, the ReportServer Active Server Page (RPTSERVER.ASP) is added to your project, along with the report file you selected in the design-time control. The ReportServer Active Server Page contains the VBScript code that communicates with the Crystal Report Engine Automation Server. This page is required by any web project that uses the Crystal Report Engine Automation Server to display reports.
In addition, the design-time control adds several lines of VBScript code to your web page. This code is designed to work with the ReportServer Active Server Page and the Crystal Report Engine Automation Server to display the report selected inside the specified Crystal Smart Viewer. For information on how to edit this code, see Editing Active Server Pages, Page 47.
To test your new Active Server Page, save the file to your web server, select the page in your Project Workspace window, and choose the PREVIEW IN BROWSER command from the File menu. Visual InterDev will open your web browser and display the Active Server Page that contains the instructions to open the report.
Building Active Web Sites |
45 |
Building a Report at Runtime
The Visual InterDev Design-time ActiveX Control can build a report dynamically at runtime based on an ActiveX data source such as ActiveX Data Objects. The design-time control uses the Crystal Active Data Driver to dynamically design a generic report based on tables and fields you select from a data source connected to your project. To use the dynamic reporting features of the design-time control, first add a data source to your web project.
1With a project open in Visual InterDev, choose the DATA CONNECTION command from the Project|Add To Project menu. The Select Data Source dialog box appears.
2To select an ODBC data source, click the Machine Data Source Tab.
3Select a data source from the Data Source Name list, and click OK, or click NEW to create a new data source. Once you click OK in the Select Data Source dialog box, the data source will be added to your project.
4Save your project.
NOTE: You may be required to specify logon information when you select a data source. For complete information on adding data sources to a web project, refer to your Visual InterDev documentation.
Now that your project contains a data source, the Visual InterDev Design-time ActiveX Control can be used to create an Active Server Page that dynamically creates and displays a report based on this data source.
1Choose the NEW command from the File menu. The New dialog box appears.
2On the Files Tab of the New dialog box, select Active Server Page.
3Enter a name for the new Active Server Page in the File name text box, and click OK. The new Active Server Page is created and appears in the Microsoft Developer Studio.
4Make sure the comment <!-- Insert HTML here --> is highlighted, and choose the ACTIVEX CONTROL command from the Insert|Into HTML menu. The Insert ActiveX Control dialog box appears.
5Click the Design-Time Tab to display the design-time ActiveX controls that are registered on your system.
6Highlight the CrystalReport.DTC design-time control, and click OK.
7Close the Properties dialog box if it appears. The Visual InterDev Design-time ActiveX Control appears in the Microsoft Developer Studio window.
8Toggle the Use existing report check box off, if it is not off already.
9In the Data Connection drop-down list, select the database corresponding to the data source you added to your project.
10In the Record Source drop-down list, select a database table from the database.
11In the Columns list box, toggle the check box on for any field you want as a column in your report.
Building Active Web Sites |
46 |