- •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
Application Distribution
Although the Seagate Crystal Report Designer Component is similar to Seagate Crystal Reports, it is made up of a separate group of files. If you will be distributing your application, you need to familiarize yourself with the new runtime distribution library. Before releasing your Visual Basic applications, review the list of files in the Runtime File Requirements in online Help.
Installing the Report Designer Component
The Report Designer Component can be installed as part of the standard Seagate Crystal Reports installation process. The following sections describe installation steps specific to the Report Designer Component.
System Requirements
The Seagate Crystal Report Designer Component has the following system requirements:
¾Microsoft Windows 95, Windows 98, or Windows NT 4 (Server or Workstation)
¾Visual Basic versions 5.0 and 6.0 (Professional or Enterprise Edition)
¾Netscape Navigator or Microsoft Internet Explorer (Version 3.0 or higher)
¾x86 processor or higher
¾32 MB RAM (minimum)
¾22 MB hard drive space (minimum for a full installation)
¾CD-ROM drive
Installation
NOTE: The Seagate Crystal Report Designer Component is available with Microsoft Visual Basic 6.0 or as a download from the Seagate Software web site (www.seagatesoftware.com).
Using the Seagate Crystal Report Designer Component
This section is intended as a complete tutorial that introduces you to using the Report Designer Component in Visual Basic. First, you will add the Report Designer to a Visual Basic project. The tutorial then takes you through the steps of selecting data, designing a report through the Create Report Expert, and adding the Smart Viewer component to a Visual Basic form. Finally, you will run your application and display the report in the Smart Viewer.
Following the tutorial, you will examine the objects and the code that were added to your Visual Basic project. By understanding how a Report Designer project is created, you can leverage your knowledge of Visual Basic to customize and control how reports are displayed in your application.
NOTE: The instructions given here can be used in either version 5 or 6 of Visual Basic, except where specifically noted.
The Report Designer Component |
151 |
The following topics are discussed in this section:
The tutorial that follows in Part One will take you through the basic steps of adding the Report Designer Component to a Visual Basic project, connecting to a database through ActiveX Data Objects, designing a report in the Create Report Expert, adding the Smart Viewer control to a form, and viewing the report at runtime. Most of this work is handled through visual interfaces and Experts designed to simplify the process. However, when you create your own applications, you will quickly find the need to work directly with the controls and objects that have been added to your project, discussed in Part Two.
Part One
Adding the Report Designer Component to a Project, Page 152
Selecting Data, Page 153
The Report Expert, Page 154
Adding the Smart Viewer, Page 155
Running the Application, Page 155
Part Two
CrystalReport1 - The Report Designer Component, Page 156
CRViewer1 - The Smart Viewer Control, Page 156
The Code, Page 157
Report Packages, Page 158
Adding the Report Designer Component to a Project
The Report Designer Component is an ActiveX Designer, and a reference to the component must be added to your project. Once a reference is made from Visual Basic, the Report Designer Component can be added directly to your project.
1With Visual Basic running, select New Project from the File menu. The New Project dialog box appears.
2Select the Standard EXE icon and click OK. Visual Basic creates a new project for you with a single form.
3From the Project menu, select the Components command. The Components dialog box is displayed.
4Click the Designers Tab in the Components dialog box to see a list of all available ActiveX Designers.
5Select the Crystal Reports 7.0 ActiveX designer. The check box for this component should be toggled on.
6Click OK when finished.
7From the Project menu, select the Add ActiveX Designer submenu, then select the Crystal Reports 7.0 command that appears. A new Report Designer component is added to your project, and the Report Gallery appears inside the Visual Basic IDE.
NOTE: In Visual Basic 6.0, the command Add Crystal Reports 7.0 will appear directly on the Project menu.
The Report Designer Component |
152 |
Selecting Data
The first step to creating any report is selecting the source of the data that will be displayed. The Report Designer Component supports data sources exposed through Data Access Objects (DAO), Remote Data Objects (RDO), ActiveX Data Objects (ADO), Crystal Data Objects (CDO) through a Data Definition File, and Visual Basic Data Environments. If you have installed the full Seagate Crystal Reports product, you can also access any source of data supported by Seagate Crystal Reports, including SQL servers and ODBC data sources. In the following steps, you will connect to a data source using ADO.
1In the Report Gallery, click the Standard button to design a standard report using the Report Designer Component. The Create Report Expert appears with the Data Tab active.
NOTE: If you close the Report Gallery dialog box without selecting a report type, the Report Designer Component will assume that you wish to use an Empty Report. You will be prompted to add the Smart Viewer control to your project.
2In the Data Source section of the Data Tab, click the Project button to select a data source for your Visual Basic project. The Select Data Source dialog box appears.
NOTE: The VB Data Environment button on the Data Tab allows you to connect to an existing Visual Basic Data Environment. The Custom button allows you to connect to a data source other than RDO, ADO, DAO, or a Data Definition File. This option is only available if you have performed a complete install of Seagate Crystal Reports. For more information, refer to Working with data, Page 158.
3Verify that the first option in the dialog box, ODBC, is selected. This option allows you to connect to an ODBC data source through ADO or RDO.
4In the drop-down list below the ODBC option, select Xtreme sample data. This is a sample database and ODBC data source created when you installed Seagate Crystal Reports.
5Click the Advanced button. The Advanced Options dialog box appears.
6Make sure the ADO option is selected in the Advanced Options dialog box. You will connect to the Xtreme sample data data source through ActiveX Data Objects.
7Click OK in the Advanced Options dialog box, and notice that ADO appears in parentheses next to the ODBC option.
8Click Next in the Select Data Source dialog box. The Select Recordset dialog box appears. Now that you have specified a data source and a connection type (ADO), you must specify the data within the data source that will be used for the report.
9From the Object drop-down list, select Customer. This is the Customer table in the Xtreme database. Note that if you are familiar with the SQL query language, you could also use the SQL option and write a SELECT statement. The Build button next to the SQL option opens Microsoft Query so that you can visually build a SQL statement.
10Click Finish to return to the Create Report Expert. Notice that ado now appears in the Tables list of the Data Tab, indicating that you have selected an ActiveX Data Objects data source. You are now ready to design your report.
The Report Designer Component |
153 |
The Report Expert
Once you’ve selected a data source, you can continue designing your report through the Report Expert. The Report Expert in the Report Designer Component works exactly like the Report Expert in the Report Designer for Seagate Crystal Reports.
1Select the Fields Tab in the Create Report Expert. The Database Fields list box lists the ADO connection that you made, and all available fields from the table you selected.
2Select Customer Name in the Database Fields list box, drag and drop the field into the Report Fields list box. ado.Customer Name will appear in the list box. You have just specified that data from the Customer Name field appear in your report.
3Continue using the drag and drop procedure, or use the Add button on the Fields Tab, to add the Last Year’s Sales, City, and Region fields to your report.
4Click the Sort Tab to sort the data in your report.
5Once again, use either the drag and drop method or the Add button to select the ado.Region field, then the ado.City field and add them to the list of Sort Fields. The records in the report will be sorted first by Region, then by City within each Region.
6Select each field in the Sort Fields list box, in turn, and verify that in ascending order is specified in the Order drop-down list.
7Select the Total Tab in the Create Report Expert. For each Region, your report will specify a subtotal of the Last Year’s Sales values.
8If ado.Last Year’s Sales does not appear in the Total Fields list box, select the field from the Report Fields list box and add it now.
9With ado.Last Year’s Sales selected in the Total Fields list box, verify that sum is selected in the drop-down list below.
10Click the TopN Tab to obtain the Top N regions. Top N of Sum of ado.Last Year’s Sales should already be selected in the tab.
11Change the 5 in the where N is text box to 10. Your report will display the top 10 regions.
12Click the Graph Tab to create a graph for the report. The Graph Expert appears inside the Graph Tab.
13Click the Pie button on the Type Tab, then proceed to the Data Tab.
14Review the settings on the Data Tab. A single graph will appear in your report that contains a separate pie slice for each grouping of the Region field. The sizes of the pie slices will be determined by the subtotal obtained by adding together the values in the Last Year’s Sales field.
15Click the Style Tab of the Create Report Expert. The Expert can automatically generate an overall style or look for your report.
16Select Executive, Leading Break, and notice the image next to the list. This is the look that your report will have.
17You have finished designing your first report in the Seagate Crystal Report Designer Component. Click Finish.
The Report Designer Component |
154 |