- •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
NOTE: If you close the Create Report Expert before clicking Finish, the Report Designer Component will assume that you wish to use an Empty Report. However, the data source you selected will be available. You will also be prompted to add the Smart Viewer control to your project.
Adding the Smart Viewer
After you have finished designing your report in the Create Report Expert, you have the option of automatically adding the Smart Viewer Component to your Visual Basic project. The Smart Viewer displays your report at runtime and allows a user to navigate through the report. When you add the Smart Viewer, a new Form is added to your project, and the Smart Viewer is added to the form as an object.
When you click Finish in the Create Report Expert, the Crystal Report Expert dialog box appears.
1The first option is whether or not you want a form containing the Crystal Reports Smart Viewer added to your project. The Smart Viewer is an ActiveX control that allows you to display reports directly in a form inside your application. Click Yes, if this option is not already selected.
2The second option is whether or not the form containing the Smart Viewer should be the first form displayed when your application runs, the startup form. Click Yes for this option as well.
You could design your application so that another form is displayed initially, and the Smart Viewer form is displayed in response to some event. However, for the purposes of this demonstration, your application will simply display the report immediately upon running.
3Click OK in the Crystal Report Expert dialog box. If you look in the Project window for your Visual Basic project, you will see that a new form and the Report Designer Component ActiveX designer have been added. In addition, the Report Designer Component design window appears in the Visual Basic IDE.
4Save your new project and the attached forms. For this tutorial, you can use the name CrystalReport1 for your project.
Running the Application
Your Report Designer Component project is complete. Now, you can run the application within Visual Basic to see the results.
1Click the Start button on the Visual Basic toolbar, or select the Start command from the Run menu. The Report Designer Component connects to your data source through ADO, and generates a report based on the design you created. The report is displayed inside the Crystal Smart Viewer, which sits on a Visual Basic form object.
2Use the arrow buttons at the top of the Smart Viewer to page through the report.
3If your system is connected to a printer, click the Print Report button to print a hard copy.
4Click CA in the tree control at the left side of the Smart Viewer. The group containing California data appears in the Smart Viewer.
5Click the plus sign next to CA to expand the CA group in the tree control. Four cities are listed for California.
The Report Designer Component |
155 |
6Click San Diego in the CA group. Data for San Diego is highlighted in the Smart Viewer window.
7Select Vancouver from the drop-down list next to the Search Text button.
NOTE: If you are unsure of the name of a toolbar button, hold the mouse pointer over the button for a couple of seconds, and a tool tip will appear that indicates the button’s name.
8Click the Search Text button. Data for Vancouver is highlighted in the Smart Viewer.
9When you are finished reviewing the report in the Smart Viewer window, close the window. Your application stops running as well.
Part Two
CrystalReport1 - The Report Designer Component
The Report Designer Component is an ActiveX Designer, and an instance of the designer has been added to the Designers section of your project. The default name for the designer is CrystalReport1. Since ActiveX designers are, by definition, visual interfaces that simplify an application design task, the CrystalReport1 designer also appears inside the Visual Basic IDE.
The CrystalReport1 designer provides a simple, yet powerful environment for controlling how text and data appear inside your report. The design environment allows simple changes to text font and color, but also allows complex manipulation of data such as custom grouping. Furthermore, the design environment has been completely integrated with Visual Basic.
1Select the CrystalReport1 designer in the Project window, and click the View Code button in the Project window's toolbar. A code page appears for the CrystalReport1 designer.
2In the drop-down list at the upper left of the Code page, notice that the entire report, along with each section within the report, is represented by a separate object.
3Select one of the Section objects in the code page. You will see that Section objects have Format events. Code written for a Format event will be executed when that particular section is formatted and displayed inside the Smart Viewer.
4Close the Code page for the CrystalReport1 designer.
CRViewer1 - The Smart Viewer Control
The Smart Viewer is a standard ActiveX control that can be added to any ActiveX container. In Visual Basic, a form is the most commonly used container. When you finished designing your report in the Create Report Expert, the Crystal Report Expert dialog box allowed you to automatically add a new form to your project containing the Smart Viewer control.
The Smart Viewer is the window within which your report is actually displayed. It provides a standard set of controls and features that allow you to interact with the report, moving through pages, drilling-down on groups, and even printing the report. A report can be printed or exported to a different file format without the use of the Smart Viewer, but if you want your users to be able to review the report on screen, you will need to include the Smart Viewer in your project.
1Choose the COMPONENTS command from the Project menu. The Components dialog box appears.
The Report Designer Component |
156 |
2Scroll through the list of available components on the Controls Tab of the dialog box. Notice that the Crystal Report Smart Viewer control is toggled on.
3Click OK, and the Components dialog box closes.
4If the Visual Basic Toolbox is not available, select the Toolbox command from the View menu. Notice that a new control appears at the bottom of the Toolbox.
5Move the mouse pointer over the new control in the Toolbox, and hold it still for a couple of seconds. A Tool Tip appears with the name of the new control: CRViewer.
6In the Project window, select the form containing the Smart Viewer control. If you followed the tutorial exactly, this will be Form2.
7Click the View Object button in the toolbar for the Project window. Form2 is displayed with the Smart Viewer control. Notice that, at design time, the Smart Viewer control contains several of the basic controls used when you viewed the report at runtime. The Smart Viewer is also resizable inside the form.
NOTE: When you view the form containing the Smart Viewer control, the control may appear to completely fill the form. However, the control is a separate object inside the form and can be resized within the form.
8In the Properties window, select the CRViewer1 control from the list of objects. Properties appear that are specific to the Smart Viewer control.
The Code
Now you have seen the two principal objects added to your project, the Report Designer Component and the Smart Viewer control. The Report Designer Component provides an environment for designing powerful reports. The Smart Viewer control allows these reports to be displayed at runtime. There is only one element missing from the equation. You must have code that displays the Report Designer's report inside the Smart Viewer.
1With the form containing the Smart Viewer control active, select the Code command from the View menu. A code page for the form appears. There are three sections to the code that appears in the form, a General Declarations section, a Load event for the Form, and a Resize event for the Form.
2Examine the code in the General Declarations section:
Dim Report As New CrystalReport1
An instance of the CrystalReport1 object is declared. This object will be used in the Load event of the Form.
3Now, examine the code for the Load event of the Form:
CRViewer1.ReportSource = Report CRViewer1.ViewReport
The first line assigns the declared CrystalReport1 object to the ReportSource property of the Smart Viewer control, CRViewer1. For the Smart Viewer to display a report, it must know where to find that report. In this case, it gets the report from the Report Designer Component, CrystalReport1.
The second line of code simply tells the Smart Viewer to display the report. That is all of the code that is required.
The Report Designer Component |
157 |