
- •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

Changing OLE object images
OLE provides the means for incorporating many diverse file formats within your report. One of the most common and most valuable types of formats is images. However, data can change or be changed in a report, and images should reflect changes in data. It may be necessary to replace an OLE image with a new image at runtime.
The OLE Object provides the FormattedPicture property for getting and setting the current image displayed in an OLE object. This property can only be accessed during the Format event for the report Section containing the OLE image object.
The following examples demonstrate how to use the FormattedPicture property:
Private Sub Section1_Format(ByVal pFormattingInfo As Object)
Set Picture1.FormattedPicture = LoadPicture(“Xtreme.bmp”)
End Sub
NOTE: That if the image changes, the picture must be reloaded. OLE image controls can be assigned bitmaps (bmp), Windows metafiles (wmf), JPEG files (jpg), GIF files (gif), Icons (ico), and enhanced metafiles (emf).
NOTE: If you are familiar with COM interfaces, the FormattedPicture property can be assigned any image format that supports the IPictureDisp interface. Simply assign an instance of the interface to the property. Refer to the documentation that came with your image format tools to determine if the IPictureDisp interface is supported.
Working with Sections
All report objects, such as Fields and Text objects, are contained within Sections. Often, these can be obtained directly by referring to the name property of an object in your code. However, there may be times when you need to obtain an object through the report section it is in. For example, you may need to iterate through all objects in a section. At other times, you may have a need to make changes to the section itself.
Every report contains a collection of its sections, stored in the Sections property of the report object. Individual sections can be accessed through this collection. For example, the code below sets the height of the first section of the report (the Report Header) to half an inch (720 twips) and suppresses the second section of the report (the Page Header) so that it will not appear.
Dim Report As New CrystalReport1
Report.Sections.Item(1).Height = 720
Report.Sections.Item(2).Suppress = True
For information on how to obtain and work with other objects within a Section object, such as fields and text objects, refer to Working with the ReportObjects collection.
The Report Designer Component |
182 |

Working with the ReportObjects collection
The ReportObjects collection of a report Section object contains all report objects in that section. Report objects may be Text objects, Fields, Subreport objects, or Crosstabs. To be able to work with a particular report object, you must first obtain the object, then you must determine what type of object it is.
Usually, report objects can be addressed directly in your code based on their Name property. However, if you intend to work with several objects in a section, you may need to refer to them through a Section object in the report. The following code locates the last object in the last section of the report and assigns a value to a String variable based on the type of object it is.
Dim Report As New CrystalReport1
Dim sect As Section
Dim rptObject As Object
Dim objKind As String
Dim lastSectWithObject As Integer
lastSectWithObject = Report.Sections.Count
Set sect = Report.Sections.Item(lastSectWithObject) Do While sect.ReportObjects.Count <= 0
lastSectWithObject = lastSectWithObject - 1
Set sect = Report.Sections.Item(lastSectWithObject)
Loop
Set rptObject = sect.ReportObjects.Item(sect.ReportObjects.Count)
Select Case rptObject.Kind
Case crBlobFieldObject
objKind = “BLOB field object”
Case crBoxObject
objKind = “Box object”
Case crCrossTabObject
objKind = “CrossTab object”
Case crFieldObject
objKind = “Field object”
Case crGraphObject
objKind = “Graph object”
Case crLineObject
objKind = “Line object” Case crOleObject
The Report Designer Component |
183 |

objKind = “OLE object”
Case crSubreportObject
objKind = “Subreport object”
Case crTextObject
objKind = “Text object”
Case Else
objKind = “Unknown object”
End Select
Working with the FieldObject object
All relational databases have two standard features: records and fields. Records contain the actual data, while fields define what type of data the records contain. Records are controlled through Recordset and Resultset objects exposed by ADO, RDO, and DAO. Through such interfaces, you can also manipulate the fields in the data source. However, to manipulate the fields that appear in your report, you must obtain a FieldObject from the Report Designer object model.
A FieldObject is a feature of your report, and is, therefore, obtained through the ReportObjects collection. You can query a specific report object to find out if it is a field, then work directly with the field, and even query it for its value. The sample code below locates the first database field that appears in a report then obtains information about that field.
Dim Report As New CrystalReport1
Dim rptObject As ReportObject
Dim fldObject As FieldObject
Dim dbFieldDef As DatabaseFieldDefinition
Dim message As String
‘ Locate the first field in the report For Each sect In Report.Sections
For Each rptObject In sect.ReportObjects
‘ Is it a field?
If rptObject.Kind = crFieldObject Then Set fldObject = rptObject
‘ Is it a database field?
If fldObject.Field.Kind = crDatabaseField Exit For
End If
End If
The Report Designer Component |
184 |

Next
If fldObject.Field.Kind = crDatabaseField Then
dbFieldDef = fldObject.Kind Exit For
End If
Next
message = “The first database field in the report is: “ & _ dbFieldDef.DatabaseFieldName
MsgBox message
Working with the SubreportObject object
A SubreportObject object is, essentially, another Report Object (see Report Object, Volume 3, Chapter 2), inside the original report. Once you have obtained a SubreportObject, you can work with any aspect of it just as if it were a standard Report object.
NOTE: You can not print, export, or display in the Smart Viewer a subreport outside of its primary report. The SubreportObject can be manipulated in any way that Report objects are, but they can only be printed, exported, or displayed as part of the primary report.
A SubreportObject is obtained through the ReportObjects collection. The following example shows how to iterate through the sections of a report and change the background color of each subreport to magenta.
Dim Report As New CrystalReport1
Dim subReport As SubreportObject
For Each sect In Report.Sections
For Each rptObject In sect.ReportObjects
If rptObject.Kind = crSubreportObject Then
Set subReport = rptObject subReport.BackColor = RGB(255, 0, 255) Set subReport = Nothing
End If
Next
Next
NOTE: Currently, the Seagate Crystal Report Designer Component does not support subreports inside of subreports. The report iterations can not go more than one subreport deep. However, you can have multiple subreports inside the main report.
For more information on working with the ReportObjects collection, see Working with the ReportObjects collection, Page 183.
The Report Designer Component |
185 |