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

Working with Parameter Values and Ranges
Parameters can contain discrete values, ranges, or both discrete values and ranges together. The following discussion outlines how Seagate Crystal Reports handles parameter values and ranges.
Before retrieving a parameter current value or range, Call PEGetParameterValueInfo, Volume 2, Chapter 1, to determine what type of value(s) are stored. PEParameterValueInfo, Volume 2, Chapter 1, member hasDiscreteValues will contain one of the following three constants.
Constant |
Description |
|
|
|
|
PE_DR_HASRANGE |
Only ranges are present. |
|
|
PE_DR_HASDISCRETE |
Only discrete values are present. |
|
|
PE_DR_HASDISCRETEANDRANGE |
Both discrete values and ranges are present. See |
|
guidelines below. |
|
|
The functions listed below are used to add and retrieve parameter discrete values and parameter ranges. The sequence of functions that you call in your application will depend on whether discrete values, ranges, or a combination of both are present.
PEXXXParameterCurrentValue(s) |
PEXXXParameterCurrentRange(s) |
|
|
|
|
PEGetNParameterCurrentValues, Volume 2, Chapter 1 |
PEGetNParameterCurrentRanges, Volume 2, Chapter 1 |
|
|
PEGetNthParameterCurrentValue, Volume 2, Chapter 1 |
PEGetNthParameterCurrentRange, Volume 2, Chapter 1 |
|
|
PEAddParameterCurrentValue, Volume 2, Chapter 1 |
PEAddParameterCurrentRange, Volume 2, Chapter 1 |
|
|
Use the following guidelines when deciding which sequence of functions to call.
PEParameterValueInfo.hasDiscreteValues = PE_DR_HASRANGE
¾The parameter field contains only ranges.
¾All values will be treated as ranges.
¾Use the PEXXXParameterCurrentRange(s) function calls. PEParameterValueInfo.hasDiscreteValues = PE_DR_HASDISCRETE
¾The parameter field contains only discrete values.
¾All values will be treated as discrete values.
¾Use the PEXXXParameterCurrentValue(s) function calls. PEParameterValueInfo.hasDiscreteValues = PE_DR_HASDISCRETEANDRANGE
¾The parameter field contains both discrete values and ranges.
¾All values will be treated as ranges.
¾Use the PEXXXParameterCurrentRange(s) function calls.
¾You can also call PEAddParameterCurrentValue to add a discrete value, but the discrete value will be stored internally as a range and you will need to call PEGetNParameterCurrentRanges and then PEGetNthParameterCurrentRange when you want to retrieve it. If you try to retrieve the discrete
Crystal Report Engine |
83 |

value using PEGetNParameterCurrentValues, 0 will be returned.
Working with section codes
The following topics relating to section codes are presented in this section.
Overview, Page 84
Encoding, Page 84
Decoding, Page 86
Section Map, Page 87
Section Codes in Visual Basic, Page 88
Overview
A report, by default, contains five areas: Report Header, Page Header, Details, Report Footer, and Page Footer. Each of those areas can contain one or more sections. When you add groups, subtotals, or other summaries to your report, the program adds Group Header and Group Footer areas as needed, and each of those areas can contain one or more sections as well. Since one report can have a totally different section configuration from the next, Seagate Crystal Reports uses calculated section codes to identify the sections in each report.
In Seagate Crystal Report Engine API functions that affect report sections, the sectionCode parameter encodes the section type, the group number (if the section is a Group Header or Group Footer section), and the section number (if there are multiple sections in an area) together in a single value.
The Seagate Crystal Report Engine API also includes macros for encoding section codes (PE_SECTION_CODE, for use with functions that require a section code) and for decoding section codes (PE_SECTION_TYPE, PE_GROUP_N, and PE_SECTION_N, for use with functions that return a section code). The examples that follow show how the encoding and decoding macros can be used.
NOTE: You can not pass the above values directly to a function as section codes. You must use the encoding macro to create a valid section code based on one of the above constants.
Encoding
The PE_SECTION_CODE macro allows you to define a section code to pass as a parameter in Seagate Crystal Report Engine functions that require a section code. The syntax for the macro is:
PE_SECTION_CODE (sectionType, groupNumber, sectionNumber)
The PE_AREA_CODE macro allows you to define a corresponding area code. The following syntax is used:
PE_AREA_CODE(sectionType,groupN)
Crystal Report Engine |
84 |
sectionType
This indicates the report area or section type that the section is in. For section type, use any of the following constants:
Section Type Constant |
Value |
Description |
|
|
|
|
|
|
PE_SECT_REPORT_HEADER |
1 |
Report Header Section |
|
|
|
PE_SECT_PAGE_HEADER |
2 |
Page Header Section |
|
|
|
PE_SECT_GROUP_HEADER |
3 |
Group Header Section |
|
|
|
PE_SECT_DETAIL |
4 |
Detail Section |
|
|
|
PE_SECT_GROUP_FOOTER |
5 |
Group Footer Section |
|
|
|
PE_SECT_PAGE_FOOTER |
7 |
Page Footer Section |
|
|
|
PE_SECT_REPORT_FOOTER |
8 |
Report Footer Section |
|
|
|
PE_ALLSECTIONS |
0 |
All Report Sections |
|
|
|
groupNumber
Indicates which group the section is in. If the sectionType value indicated is PE_SECT_GROUP_HEADER or PE_SECT_GROUP_FOOTER, the groupNumber is a zero (0) based index for the group section. If the sectionType value is not one of these group section constants, the groupNumber value should always be zero.
sectionNumber
If the report area has been split into more than one section, sectionNumber indicates which section within the area you are using. This value is a zero (0) based index. In other words, the first section in an area is 0, the next section is 1, etc.
NOTE: The macro PE_SECTION_CODE calculates and returns the section code number; it does not return an error code.
The following example demonstrates how to obtain a section code using the PE_SECTION_CODE macro. The section code obtained here is for the second section in the Group Header 1 area:
code = PE_SECTION_CODE(PE_SECT_GROUP_HEADER, 0, 1); PESetSectionFormat(job, code, &mySectionOptions);
In this case you pass the section type (PE_SECT_GROUP_HEADER), the group number (since this is the first group, use the zero indexed group number 0) and section number (since this is the second section in the Group Header, use the zero indexed section number 1). The program uses the encoding macro and returns a section code which is then passed in the PESetSectionFormat call.
Crystal Report Engine |
85 |
When using PE_ALLSECTIONS in your macro, code can be written in one of two ways:
code = PE_SECTION_CODE(PE_ALLSECTIONS, 0, 0);
// the code value returned is 0 - NOT an error code PESetSectionFormat(job, code, &mySectionOptions);
or, you can eliminate using the macro all together:
PESetSectionFormat(job, PE_ALLSECTIONS, & mySectionOptions)
NOTE: The maximum number of groups is 25 (possible values of 0 to 24). The maximum number of sections is 40 (possible values of 0 to 39).
Decoding
Some Seagate Crystal Report Engine functions return section codes. These values can be decoded using one of three macros:
1.PE_SECTION_TYPE (sectionCode),
2.PE_GROUP_N (sectionCode), or
3.PE_SECTION_N (sectionCode).
Each macro accepts an encoded section code as a parameter.
In the following example, you determine the number of sections in the report (using PEGetNSections), obtain the section code for each section (using PEGetSectionCode), and then decode the section code using the PE_SECTION_TYPE, PE_GROUP_N, and PE_SECTION_N macros.
numSections = PEGetNSections(job); for (i = 0;i < numSections;i++)
{
code = PEGetSectionCode(job, loopSectionN); areaType = PE_SECTION_TYPE(code);
groupN = PE_GROUP_N(code); sectionN = PE_SECTION_N(code);
// Perform section specific code here
}
Once you’ve identified the area, group, and section you want, you can then set the section format using code similar to this:
PESetSectionFormat(job, code, &mySectionOptions);
NOTE: Earlier versions of Seagate Crystal Reports used different section code constants. Those constants have been remapped to the new section code format so reports created with earlier versions of Seagate Crystal Reports can run with applications created with the current version.
Crystal Report Engine |
86 |

Section Map
The following map shows the pattern of section code assignment:
Report Header
1000 |
First Section in Report Header Area |
|
|
1025 |
Second Section in Report Header Area |
|
|
1050 |
Third Section in Report Header Area |
|
|
1075 |
Fourth Section in Report Header Area |
|
|
up to 1975 |
40th Section in Report Header Area |
|
|
Page Header |
|
|
|
2000 |
First Section in Page Header Area |
|
|
2025 |
Second Section in Page Header Area |
|
|
2050 |
Third Section in Page Header Area |
|
|
2075 |
Fourth Section in Page Header Area |
|
|
up to 2975 |
40th Section in Page Header Area |
|
|
GH1 |
|
|
|
3000 |
First Section in First Group Header Area |
|
|
3025 |
Second Section in First Group Header Area |
|
|
3050 |
Third Section in First Group Header Area |
|
|
3075 |
Fourth Section in First Group Header Area |
|
|
GH2 |
|
|
|
3001 |
First Section in Second Group Header Area |
|
|
3026 |
Second Section in Second Group Header Area |
|
|
3051 |
Third Section in Second Group Header Area |
|
|
3076 |
Fourth Section in Second Group Header Area |
|
|
Details |
|
|
|
4000 |
First Section in Details Area |
|
|
4025 |
Second Section in Details Area |
|
|
4050 |
Third Section in Details Area |
|
|
4075 |
Fourth Section in Details Area |
|
|
Crystal Report Engine |
87 |

GF1
5000 |
First Section in First Group Footer Area |
|
|
5025 |
Second Section in First Group Footer Area |
|
|
5050 |
Third Section in First Group Footer Area |
|
|
5075 |
Fourth Section in First Group Footer Area |
|
|
GF2 |
|
|
|
5001 |
First Section in Second Group Footer Area |
|
|
5026 |
Second Section in Second Group Footer Area |
|
|
5051 |
Third Section in Second Group Footer Area |
|
|
5076 |
Fourth Section in Second Group Footer Area |
|
|
Page Footer |
|
|
|
7000 |
First Section in Page Footer Area |
|
|
7025 |
Second Section in Page Footer Area |
|
|
7050 |
Third Section in Page Footer Area |
|
|
7075 |
Fourth Section in Page Footer Area |
|
|
Report Footer |
|
|
|
8000 |
First Section in Report Footer Area |
|
|
8025 |
Second Section in Report Footer Area |
|
|
8050 |
Third Section in Report Footer Area |
|
|
8075 |
Fourth Section in Report Footer Area |
|
|
Section Codes in Visual Basic
The following functions provide Visual Basic equivalents.
Create a section code:
¾This representation allows up to 25 groups and 40 sections of a given type, although Seagate Crystal Reports itself has no such limitations.
Function PE_SECTION_CODE(sectionType As Integer, groupN As Integer, sectionN As Integer) As Integer
PE_SECTION_CODE = (((sectionType) * 1000) + ((groupN) Mod 25) +
(((sectionN) Mod 40) * 25))
End Function
Crystal Report Engine |
88 |