- •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
Programming Tips
The following topics are discussed in this section.
Always Set ReportName First, Page 209
Discard Saved Data, Page 210
Verify Database, Page 210
Connecting to SQL Servers, Page 210
Changing Tables & Formulas, Page 211
Changing Groups & Summary fields, Page 211
Using the Send methods, Page 211
Using the JobNumber property, Page 212
Always Set ReportName First
When writing code to run a report using the VCL component, be sure to set the ReportName property first. The reason for this is that the VCL monitors any changes to ReportName, and when it is changed, it clears out any subreport information as well as the following properties for the main report:
AreaFormat |
Margins |
|
|
AreaFormatFormulas |
ParamFields |
Connect |
PrintDate |
|
|
DetailCopies |
ReportTitle |
|
|
Formulas |
SectionFont |
|
|
GraphData |
SectionFormat |
GraphOptions |
SectionFormatFormulas |
GraphText |
Selection |
|
|
GraphType |
SectionMinHeight |
|
|
GroupCondition |
SessionInfo |
|
|
GroupOptions |
SortFields |
GroupSelection |
SQLQuery |
|
|
GroupSortFields |
SQL.Params |
|
|
LogOnInfo |
Tables |
|
|
Therefore, if any of these properties have been set before ReportName, they will be cleared when the ReportName property is assigned a new value.
Seagate Crystal Visual Component Library |
209 |
Discard Saved Data
Beware of saving Reports from the Seagate Crystal Report Designer with the Saved Data toggle on (this option is located on the Report Options dialog box from the File menu), unless you want them that way. When they are run from Delphi, if you don't set the DiscardSavedData property to True, the report will run from the Saved Data (which is the default mode), and will not show the changes that have been made to the database.
After a report has been run via the VCL once, and the Print Job has not been closed (either via the CloseJob method or changing the ReportName property), the report that is currently in memory now has Saved Data. If you run it again, it will run with the Saved Data from the first run. This means that some of the changes you pass in the second time, may not have any effect. The solution is to set the DiscardSavedData property to True.
Verify Database
Under the Database menu in Seagate Crystal Report Designer, there are two menu items: Verify Database and Verify on Every Print. Since the database structure and index information are stored in a report file when it is saved, the report may have problems running if the database structure changes.
One solution is to load the report into the Designer, and choose Verify Database, then resave the report. This works fine during development, but if the database structure will be changing during runtime operation, there is no equivalent for these Verify commands in the runtime engine. Therefore, Verify on Every Print should be turned on in these instances. With this option on, the report will reread the database structure every time the report runs. The amount of time taken to do this extra step is usually minimal. If the database structure will not change after deployment, there is no reason to turn this feature on.
Connecting to SQL Servers
With this Component, you have three different ways of establishing a connection to an SQL DataSource or Server: LogOnServer, LogOnInfo, and Connect. We recommend you review these sections in the Help file to determine which method suits your needs best.
One thing to keep in mind when connecting to SQL databases, is that if the database is being accessed via ODBC drivers in the report, then the ServerName property of the above-mentioned methods represents the ODBC DataSource Name, not the actual Server Name. On the other hand, if the database is being accessed via Crystal's native SQL drivers, then the ServerName property of the LogOnServer, LogOnInfo, and Connect objects represents the actual SQL Server name.
Another thing to watch for is that some table locations are stored in a report as <db name>.<owner>.<table name>. Attempting to change the ServerName for such a report at runtime could cause it to look for the tables on the original Server instead of the new one, which usually results in a connection error. The solution is to remove the <db name> and <owner> prefixes so that just the table name is listed. This can be done in the report (Set Location dialog box in Crystal Reports), or via the Component’s Tables object.
Seagate Crystal Visual Component Library |
210 |
Changing Tables & Formulas
When changing the table names that a report is based on, it is important to remember that formula fields will use the report's alias name for the table, and not the new table name.
For example, suppose you have a report which uses the Company1 table. When you added Company1 to the report, an Alias was created for it by Seagate Crystal Reports called Company1. When the field is used in a Formula, it appears like this:
(* company1.Field *)
However, company1 represents the alias and not the actual table name. So, in the Delphi program, when you change the table name from company1 to company2, the formula still sees the field as (* company1.Field *), and not (* company2.Field *), since the alias Seagate Crystal Reports assigned remains the same. One thing to remember in this respect is that Seagate Crystal Reports’ aliases can only be changed in the designer, not at runtime.
Changing Groups & Summary fields
When changing Grouping fields at runtime via the GroupCondition or GroupOptions object, remember that any inserted summary fields, or formulas containing summary fields in the report may cause errors, since they contain the grouping field name as the second element of their parameters. For example, take the following Summary field:
Sum((* company.SALES *), (* company.STATE *))
This formula sums the amount of company sales per State. This summary field assumes that (* company.STATE *) is one of the grouping fields. If the grouping field is changed from (* company.STATE *) to (* company.COUNTRY *), this formula field will generate an error.
The way to avoid this problem is to insert the grouping field into a formula field when designing the report. Then when you create the group, base it on the formula field. Any summary fields inserted will also look at the formula field as the grouping field, regardless of what it contains. Then to change the group field at runtime, simply pass a new (* table.field *) value to the formula field. All the summaries will automatically change.
Using the Send methods
Since the VCL's Execute method uses the Send methods from the VCL's sub-class objects, there is usually no need to call these methods in code. However, there are at least two cases where this can be advantageous:
1.For changing the order in which items get sent to the Print Engine. For example, the Execute method of the VCL sends the Formulas first, and then the Grouping information. If GroupOptions.Send is called just before Execute, this has the effect of sending in the Grouping information before the Formulas.
2.For testing the VCL and/or the Print Engine. Properties can be set and then passed from the VCL to the Print Engine by calling the Send method. Then the values can be retrieved using the Retrieve method and examined to make sure they are getting passed correctly.
Seagate Crystal Visual Component Library |
211 |