- •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
Crystal Reports |
Crystal Reports VCL Component |
|
|
|
|
Subreports |
Subreports |
|
|
Summary Info |
SummaryInfo |
Before attempting to use these properties, please read the following section:
Dealing with SubClass Objects
Since the architecture of the VCL has changed substantially from previous releases, here is a brief programming introduction to acquaint you with the changes. As mentioned in the Introduction, the main change in the architecture is the implementation of numerous subclasses.
An example: the Tables object
For example, the Tables subclass now encapsulates all the functionality of what was called Datafiles and DatafilesLocation in the previous releases. This subclass consists of 10 properties and 8 methods. Of the 10 properties, the most essential are these three:
Number
Name
Path
Formerly, the Datafiles property was programmed like this:
Crpe1.Datafiles[0] := 'c:\MyNewPath\MyNewTable.dbf';
The subscript "[0]" represented the table number, 'c:\MyNewPath\' represented the Path, and 'MyNewTable.dbf' represented the table name. With the new VCL, the Tables object would be used instead of the Datafiles stringlist. So the same statement would be coded like this:
Crpe1.Tables.Add(0);
Crpe1.Tables.Path := 'c:\MyNewPath\';
Crpe1.Tables.Name := 'MyNewTable.dbf';
The Add method instructs the Tables object to add an item with table number zero. Instead of this, you could use the Retrieve method, which retrieves all the table information from the report (this is the same as what was formerly called RetrieveDatafiles):
Crpe1.Tables.Retrieve;
After Retrieve has been called, you need to instruct the Tables object to navigate to the item whose properties you want to change. This is necessary because the Tables object only looks at one table at a time. Think of it as something similar to scrolling through the records of a database. There are a number of properties that can be used to navigate through the object: Item, ItemIndex, and Number.
Seagate Crystal Visual Component Library |
203 |
Each object in the Crystal VCL that can contain more than one item, uses an internal Index to maintain which item it is currently looking at, similar to the ItemIndex property of a list box. This Index is updated whenever the Item property is used (LogOnInfo[2], for example), or whenever the key property (if applicable) is assigned a new lookup value. Key properties are things like Formulas.Name, or SortFields.Number; properties that contain a unique value for each item, and which serve as look up properties. They appear as drop-down lists in the Object Inspector.
Number is the key property for the Tables object. Assigning a new value to the Number property will not overwrite the value stored there, but will rather cause the Tables object to try and find that new value, and point to the table that has the value. For example:
Crpe1.Tables.Number := 2;
This will cause the Tables object to look internally for a table with the number 2. If it finds it, the object will now point it's properties to that table and will remain pointing there until it is changed. That is one way of navigating through the tables.
The ItemIndex property can also be used to navigate through the Tables object:
Crpe1.Tables.ItemIndex := 2;
Although in this case, ItemIndex represents the position of the table in the internal Tables list, not necessarily the table number (although if Retrieve is used, these should be the same).
By far the easiest and most natural way of navigating through the Tables object is the default array property, Item. Since this is a default property, it does not need to be specified when making the call, so Tables[2] is the same as Tables.Item[2]. And since the Item property returns a reference to the Tables object, it is possible to add other properties to the end of the subscript:
Crpe1.Tables[2].Path := 'c:\MyNewPath\';
Crpe1.Tables[3].Name := 'MyNewTable.dbf';
While initially this might seem like a lot more work, it actually is much more powerful, especially when dealing with items that have a dozen properties, such as the SectionFormat object. With SectionFormat, the old method involved passing a large string of about a dozen items separated by semicolons. Even if you only wanted to set one property, you still had to pass the whole string. With the new object format, you only need to set the property that you want to change.
Consistent Code
One of the reasons for making the properties into objects is that the coding syntax is more consistent. For example, there are a number of methods associated with the Tables object:
Crpe1.Tables.Retrieve;
Crpe1.Tables.Count;
Crpe1.Tables.Clear;
Seagate Crystal Visual Component Library |
204 |
They are much easier to code and to remember, and more consistent, than the old calls:
Crpe1.RetrieveDatafiles;
Crpe1.GetNDatafiles;
Crpe1.Datafiles.Clear;
And since each object in the new Component uses the same naming convention for the same methods, they are very easy to remember.
Using the Retrieve method
It is important to remember that in the older versions of the Component, most of the properties were derived from modified stringlists and the declaration Crpe1.Datafiles[0] would add a string to the list of subscript 0. The new Component's subclass objects do not work the same way. Instead, there are two methods now used to add an item to the list.
The first, and preferred way, is to use the Retrieve method. This retrieves the table information from the report, and stores it in the Tables object, so that all the necessary table items are already present. You just need to set the object to the desired table and then change the desired properties. This would be coded as:
(* Retrieves tables from report *) Crpe1.Tables.Retrieve;
(* Modifies path of first table *) Crpe1.Tables[0].Path := 'c:\MyNewPath\'; (* Modifies name of first table *) Crpe1.Tables[0].Name := 'MyNewTable.dbf';
For changing the path of more than one table at a time, a simple loop can be constructed. Since the tables property is now an object, it was easy to add methods and properties to it that made it behave like a stringlist. So the Count method and ItemIndex properties were added, as well as the default array property, Item. The Item property allows you to treat the Tables object as if it were a stringlist (Tables[0] is equivalent to Tables.Item[0]):
(* Retrieves tables from report *)
Crpe1.Tables.Retrieve;
for cnt := 0 to (Crpe1.Tables.Count - 1) do begin
(* Modifies path of table *)
Crpe1.Tables[cnt].Path := 'c:\MyNewPath\';
end;
Seagate Crystal Visual Component Library |
205 |
The second way of adding items to the Tables object would be to do it manually by using the Add method. The Retrieve method is not called. Instead it is up to the programmer to know how many tables are in the report, or to know which tables he wants to change. This method would be coded like as:
(* Adds table 0 to Tables object *) Crpe1.Tables.Add(0);
(* Set path of first table *) Crpe1.Tables.Path := 'c:\MyNewPath\'; (* Set name of first table *) Crpe1.Tables.Name := 'MyNewTable.dbf';
In the above example, it is not necessary to include the subscript [n] after the Tables object name. This is because the Tables object has an internal index that keeps track of which Table item it is currently looking at. To be compatible with future revisions of the Component, it would better to use a subscript as follows:
(* Adds table 0 to Tables object *)
Crpe1.Tables.Add(0);
(* Set path of table just added *)
Crpe1.Tables[Crpe1.Tables.Count - 1].Path := 'c:\MyNewPath\';
(* Set name of table just added *)
Crpe1.Tables[Crpe1.Tables.Count - 1].Name := 'MyNewTable.dbf';
Working with subreports
If the report has subreports, the subreports names can be stored in the Seagate Crystal Component by using the Subreports object and its Retrieve method:
Crpe1.Subreports.Retrieve;
When this call is made, a Tables object is set up for each subreport. Subreport tables are handled in exactly the same way as shown above except that you must specify which subreport you are working with before handling the Tables object:
(* Retrieves the subreports *)
Crpe1.Subreports.Retrieve;
(* Sets the Component to subreport 1 *)
Crpe1.Subreports[1];
(* Retrieves the tables for subreport 1 *)
Crpe1.Tables.Retrieve;
It is important to remember, the Subreports object stores the main report information as the first item in the object, so Subreports[0] refers to the main report. Of course, the Subreport object can also be handled manually through it's Add method instead of using the Retrieve method, but in most cases, this will prove to be more difficult to code and to maintain.
Seagate Crystal Visual Component Library |
206 |
Here is a simple code example which illustrates how to fill the Seagate Crystal Component with report information, which can then be edited and sent back to the Print Engine:
Crpe1.ReportName := 'c:\MyCrystalReport.rpt';
Crpe1.Subreports.Retrieve;
Crpe1.Printer.Retrieve;
Crpe1.PrintOptions.Retrieve;
Crpe1.SummaryInfo.Retrieve;
for cnt := 0 to (Crpe1.Subreports.Count - 1) do
begin
Crpe1.Subreports[cnt];
Crpe1.LogOnInfo.Retrieve;
Crpe1.Connect.Retrieve;
(* Do not do SQL Retrieve here because it slows down loading while trying to Logon to the Server. Use the SQL.Retrieve method after filling in the Password property of the Connect or LogOnInfo objects *)
Crpe1.SQL.Params.Retrieve;
Crpe1.Tables.Retrieve;
Crpe1.Selection.Retrieve;
Crpe1.GroupSelection.Retrieve;
Crpe1.Formulas.Retrieve;
Crpe1.ParamFields.Retrieve;
Crpe1.GraphType.Retrieve;
Crpe1.GraphText.Retrieve;
Crpe1.GraphData.Retrieve;
Crpe1.GraphOptions.Retrieve;
Crpe1.SectionFormat.Retrieve;
Crpe1.SectionFormatFormulas.Retrieve;
Crpe1.AreaFormat.Retrieve;
Crpe1.AreaFormatFormulas.Retrieve;
Crpe1.SectionFont.Retrieve;
Crpe1.SectionMinHeight.Retrieve;
Seagate Crystal Visual Component Library |
207 |