- •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
The first line of code creates an instance of the MyDataSource object in your application, much like you might create an instance of an ADO Recordset object. The second line of code added uses the SetDataSource method inside the Crystal Designer Component library to dynamically change the source of data used by your report.
If you designed your report using an ADO, DAO, or RDO data source, or by using a Data Definition file, then your report uses the Active Data Driver to access the report data at runtime. Since the Active Data Driver also supports data sources that expose the Crystal Data Source interface, you can easily assign the MyDataSource object to your report.
Crystal Data Source Projects
Now that you have seen the extensive power of the Crystal Data Source interface implemented inside a Visual Basic class, you can begin to consider the extensive possibilities for its use. Many computer based operations produce continuous streams of data in real-time. In your own work, you may encounter needs for gathering data from process control systems, data acquisition applications, or computer-based instrumentation.
In these kinds of applications, data is usually gathered and stored for later analysis. Systems running in realtime, however, may need real-time monitoring and reporting. With objects that implement the Crystal Data Source interface, you can gather and move through data as it is generated, then produce up to the instant analysis through reports.
Programmer’s building n-tier applications that operate across a network may often find themselves designing business objects and other business rules components. By implementing the Crystal Data Source interface in business object components, you can design reports that produce real-time information about data traveling across the network. Even Microsoft Transaction Server components can implement a fully functional ActiveX data source for reporting. Crystal Data Source takes your applications from runtime to real time.
Grid Controls and the Crystal Report Engine
This topic is only supported by the Professional Edition of Seagate Crystal Reports.
In Seagate Crystal Reports, a Crystal ActiveX Control can be bound directly to a Visual Basic Data Control. Using the Visual Basic Data Control with the Crystal ActiveX Control offers the following benefits:
●Generating reports in Visual Basic programs is made even easier and does not require an existing .RPT file.
●A powerful feature of Visual Basic is ad-hoc queries that are run by executing SQL statements in the RecordSource property of the Data Control. By directly binding a Crystal Custom Control to a Data Control, users can now create reports of dynaset data which are the results of such ad-hoc queries.
Visual Basic Solutions |
139 |
The following topics are discussed in this section:
Bound Report Driver and Bound Report Files, Page 140
Crystal ActiveX Control Properties, Page 140
Creating a Bound Report using the Crystal ActiveX Control, Page 141
Creating a Formatted Bound Report, Page 142
Creating a Formatted Bound Report at Runtime, Page 142
Sample Application, Page 143
Bound Report Driver and Bound Report Files
When using Seagate Crystal Reports to generate reports from database files of a particular file format (for example, Paradox file format), you need to have the appropriate report driver (i.e., PDBPDX.DLL) to retrieve data from the databases. Similarly, when you generate reports by binding to a Visual Basic Data Control, a Bound Report Driver (PDBBND.DLL) is used to retrieve data from the Data Control. Make sure PDBBND.DLL is in your \WINDOWS\SYSTEM directory or search paths, along with other database drivers.
Crystal ActiveX Control Properties
Several properties are added to the Crystal Custom Control in order to support bound reports. These new properties are described below.
Custom
This property allows you to create bound .RPT files at Visual Basic design time and is not available at runtime. After a bound .RPT file is created, programmers can then use Seagate Crystal Reports to customize the report layout or even link the bound data to other database tables.
DataSource (Data Control)
This property can be read/write at design time and runtime. This property is ignored if the ReportSource property is 0 (Report files). To generate bound reports, set this property to the Data Control you want to retrieve data from. The Data Control must already be on the form before this property can be set.
BoundReportFooter (Boolean)
This property can be read/write both at design-time and runtime. This property is ignored if the ReportSource property is 0 (Report files). Default is False and the bound reports generated will not have page numbers printed. If set to True, page numbers will be printed at the bottom of a page.
Visual Basic Solutions |
140 |
BoundReportHeading (string expression)
This property can be read/write both at design time and runtime. This property is ignored if the ReportSource property is 0 (Report files). It specifies the report title at the beginning of a bound report. If it is blank, no report title will be printed.
ReportSource (numeric expression)
This property can be read/write both at design time and runtime. The allowed values are:
0 - Report files
1 - Bound TrueDBGrid Control
3 - All Data Control Fields
The default value is 0 - Report files, and the ReportFileName property must be assigned to an existing report path name (.RPT). This is equivalent to when the new bound report features were not available and all reports were generated from existing .RPT files.
When set to 1 or 3, the ReportFileName property will be ignored and no .RPT file is needed. Reports will be created using data retrieved from Data Control. The reports generated directly from the Data Control are identical to the reports generated from the respective bound .RPT files created using the (Custom) property described above.
Creating a Bound Report using the Crystal ActiveX Control
1Add the following controls to your Visual Basic form:
2On the Data Control:
3Set the DatabaseName property to the name of the database being reported on.
4Set the RecordSource property (this can be a database table or a SQL query statement).
5On the Crystal ActiveX Control:
6Set the DataSource property to the Data Control (for example, Data1).
7Set the ReportSource to 3 - All Data Control Fields.
8On the Command Button, add the following code for the Click event:
Private Sub Command1_Click() CrystalReport1.Action = 1
End Sub
Run the application, click the command button, and the Crystal ActiveX Control will retrieve data from the Data Control and create the report. The report will appear as a simple columnar report. There are no runtime properties to control any report formatting. However, this can be accomplished at design-time by editing the report designed by the ActiveX control (a report template) in Seagate Crystal Reports.
Visual Basic Solutions |
141 |
Creating a Formatted Bound Report
1Add the Data control, ActiveX control, and a command button to your form.
2On the Data control, set the DatabaseName property and the RecordSource property as you did in the previous example.
3On the ActiveX control:
●Set the DataSource property to the Data Control (i.e., Data1).
●Set the ReportSource property to 3 - All Data Control Fields.
●Open the Custom property and select the Data-Bound Report Tab.
●Click the Save Report As button and enter a name for the report.
4Open the report template in Seagate Crystal Reports and apply any formatting that you want including spacing between columns, font size, colors, grouping, and totaling. Save the report template again when finished.
5In your Visual Basic application, set the following properties for the ActiveX control:
●Set the ReportSource to 0 - Report File.
●Set the ReportFileName to the .RPT file that you saved (include the complete path of the file).
6On the command button, add the following code to the Click event:
Private Sub Command1_Click()
CrystalReport1.Action = 1
End Sub
Now, the application will create the report at runtime with the formatting you have applied.
Creating a Formatted Bound Report at Runtime
The following steps describe an alternative method of creating formatted bound reports:
1Create your Visual Basic application as in the first example above.
2Set the ActiveX Control to print to a preview window, and run the application.
3Click the Export button in the preview window, and export the report to a disk file in .RPT format.
4Once the report has been exported, you can open it up in Seagate Crystal Reports.
5Perform all formatting changes that you want and save the report.
6Return to the Visual Basic application and stop it if it is still running.
7On the ActiveX Control:
8Set the ReportSource to 0 - Report File.
9Set the ReportFileName to the .RPT file that you created.
10Run the Visual Basic application and you will be able to see your bound report with the formatting changes you've made.
Visual Basic Solutions |
142 |