- •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
Viewing the Crystal Report Engine Object Library
The Visual Basic Object Browser allows you examine the classes, methods, and properties exposed by any ActiveX component available to your project. If you have selected the Crystal Report Engine Object Library using the References dialog box (see Adding the Automation Server to your Visual Basic Project, Page 111), then you can browse through the Object Library using the Visual Basic Object Browser:
1With your project open in Visual Basic, choose OBJECT BROWSER from the View menu. The Object Browser appears.
2From the Libraries/Projects drop-down box, select the Crystal Report Engine Object Library. Classes, methods, and properties exposed by the Object Library will appear in the Object Browser.
3Select a class in the Classes/Modules list box to view its methods and properties in the Methods/ Properties list box.
NOTE: While viewing the Crystal Report Engine Object Library in the Visual Basic Object Browser, you may notice several classes, methods, and properties that are not documented in the Seagate Crystal Reports Technical Reference. There are several features in the Crystal Report Engine Automation Server that are not available with Seagate Crystal Reports, and are protected by a security feature built into the Object Library. These features will become available in future Seagate Software products. Contact Seagate Software’s Sales department for further information.
Seagate Crystal Reports also provides the Crystal Report Engine Object Library Browser Application as a convenient utility for accessing online information about the Crystal Report Engine Object Library. Simply choose the Xtreme Mountain Bike option in the Sample Files when installing, or choose an automatic installation (the files will be installed by default) to install the utility, then browse through the Object Library using the tree control. Select a class, method, or property for more information on how to use it.
Handling Preview Window Events
The Report and Window objects in the Crystal Report Engine Object Library include several Events. By handling these events in your Visual Basic project, you can customize how your application responds to user actions. For instance, if a user clicks on a button in the toolbar of the preview window, such as the Zoom button or the Next Page button, your application can respond to that event.
NOTE: Events are only available in Visual Basic 5.0 and later. If you are using a version of Visual Basic earlier than 5.0, you will not be able to make use of the Events exposed by the Report or Window object.
To handle Events for the Report or Window object, you must declare the instance of the object as Public and WithEvents. For example:
Public WithEvents repEvents As CRPEAuto.Report
Public WithEvents wndEvents As CRPEAuto.Window
Once declared, the objects will appear in the Visual Basic Object window. If you select the object, its Events will be displayed, just as if you were working with any other Visual Basic object.
Visual Basic Solutions |
115 |
NOTE: The Window object events are only valid when a report is sent to a preview window using the Preview method.
The following code demonstrates how to set up and use events for both the Report object and the Window object. Actual event handling code is left for you to fill in. You are limited only by the restrictions of the Visual Basic language.
Option Explicit
Public WithEvents rpt1 As CRPEAuto.Report
Public vw1 As CRPEAuto.View
Public WithEvents wnd1 As CRPEAuto.Window
Private Sub Command1_Click()
Set vw1 = rpt1.Preview
Set wnd1 = vw1.Parent
End Sub
Private |
Sub Form_Load() |
||
Set |
app1 |
= |
CreateObject(“Crystal.CRPE.Application”) |
Set |
rpt1 |
= |
app1.OpenReport(“c:\crw\rt01.rpt”) |
rpt1.EventInfo.ActivatePrintWindowEventEnabled = True rpt1.EventInfo.ClosePrintWindowEventEnabled = True rpt1.EventInfo.GroupEventEnabled = True rpt1.EventInfo.PrintWindowButtonEventEnabled = True rpt1.EventInfo.ReadingRecordEventEnabled = True rpt1.EventInfo.StartStopEventEnabled = True
End Sub
Private Sub rpt1_Start(ByVal Destination As _ CRPEAuto.CRPrintingDestination, _ useDefault As Boolean)
' Put event handling code here.
End Sub
Private Sub rpt1_Stop (ByVal Destination As CRPEAuto.CRPrintingDestination,
ByVal Status As CRPEAuto.CRPrintingProgress)
'Put event handling code here. End Sub
Private Sub wnd1_ActivatePrintWindow()
'Put event handling code here. End Sub
Visual Basic Solutions |
116 |
Private Sub wnd1_ClosePrintWindow (useDefault As Boolean)
' Put event handling code here.
End Sub
’Other events for the Report and Window objects
’can be seen by using the Visual Basic Object Browser
’with the Crystal Report Engine Object Library.
’(a lightning bolt icon appears next to Events in
’the Object Browser.)
’Once and instance of a Report object or Window object,
’is declared, you can add Event handlers to your code by
’selecting the object in the Visual Basic Object list and
’then selecting the desired event.
For complete descriptions of all available Crystal Report Engine Object Library Events, refer to the Report Object, Volume 3, Chapter 2, and the Window Object, Volume 3, Chapter 6.
NOTE: In the previous version of Seagate Crystal Reports a report or window object variable declared WithEvents could only be Set once. A VB error occurred if you tried to Set the variable to a different value(i.e. access a new report or display a new Preview window). This problem no longer exists. You can now reset the values of WithEvent object variables.
Distributing the Automation Server with Visual Basic Applications
When you finish designing your application and decide to distribute it to your users, you must make sure that the Crystal Report Engine Automation Server is distributed with it. In addition, you must make sure the automation server gets registered on your users’ systems. The easiest way to do this is to use the Application Setup Wizard installed with Visual Basic.
This Wizard leads you through the process of designing a setup application for your project. In addition, the Setup Wizard detects any ActiveX components included in your project and leads you through the process of adding code to the setup application to include the required files and register the components on a user’s machine.
For more information about files that need to be distributed with Crystal Report Engine applications, refer to Runtime File Requirements online Help.
Sample Applications
Seagate Crystal Reports includes a complete sample application written in Visual Basic 5.0 using the Crystal Report Engine Automation Server. The Xtreme Mountain Bike Inventory Application is a complete real-world application that provides various reports to employees at a fictitious company. Report access is restricted based on user logon information. The application is located in \Program Files\Seagate Software\Crystal Reports\sample\Xtreme\Inventory and provides the option of viewing the source code for any Visual Basic form displayed.
Visual Basic Solutions |
117 |