- •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
Considerations when using the export functions
The export functions are complex function calls. To avoid errors when exporting report files from your application, keep the following things in mind:
●In order to use PEGetExportOptions, Volume 2, Chapter 1 and PEExportOptions, Volume 2, Chapter 1, you must be using the version of the Crystal Report Engine (CRPE32.DLL) that came with the Professional Edition of Seagate Crystal Reports. If you have an earlier version of CRPE32.DLL installed on your machine and its earlier in the path, the program may find it first and not find the export functions. This can happen particularly if you are upgrading to the Professional Edition of Seagate Crystal Reports from the version of Seagate Crystal Reports that was shipped with Visual Basic Professional Edition. Visual Basic included an earlier version of CRPE32.DLL. Search your disk and delete or rename earlier versions of CRPE32.DLL, or make appropriate adjustments to your path statement.
●Make sure all format DLLs and destination DLLs are located in the same directory as CRPE32.DLL. Once Windows finds CRPE32.DLL, it will expect all of the DLL files to be in the same directory. Format DLLs are all UXF*.DLL files and Destination DLLs are all UXD*.DLL files. As a general rule, it is best to keep all of these files in the \CRW directory or the directory into which you installed Seagate Crystal Reports. Also, make certain that the PATH statement in your AUTOEXEC.BAT file includes \CRW.
●The UXF*.H and UXD*.H header files are only necessary when compiling your application. These files should be copied to the same directory as your application's source files.
Handling Preview Window Events
Using the Crystal Report Engine API, you can create a Windows CALLBACK function to handle events that occur in a preview window. For instance, if a user clicks on a button in the toolbar of the preview window, such as the Zoom button or the Next Page button, Windows registers an event for the preview window.
Using the Event functions in the Crystal REAPI, you can add instructions to your own applications to perform specific actions according to events that occur in a preview window. The sample code below demonstrates how to handle preview window events by creating a CALLBACK function for the preview window, then initializing the preview window with that CALLBACK function in your Crystal Report Engine code. The code can handle toolbar button events, Group Tree events, and even drill-down events.
The Crystal Report Engine API Event functions are only valid when a print job is sent to a preview window using PEOutputToWindow.
#include “crpe.h” #include “Windows.h”
//The EventCallback function is defined as a standard
//Windows CALLBACK procedure. Return TRUE to allow the
//Crystal Report Engine to provide default behavior.
//Return FALSE to prevent default behavior from being carried out.
Crystal Report Engine |
97 |
//The comment TODO indicates where you need to add event
//handling code specific to your application.
#if defined (WIN32)
BOOL CALLBACK EventCallback (short eventID,
void *param, void *userData)
#else
BOOL CALLBACK __export EventCallback (short eventID,
void *param, void *userData)
#endif
{
switch(eventID)
{
case PE_CLOSE_PRINT_WINDOW_EVENT: case PE_PRINT_BUTTON_CLICKED_EVENT: case PE_EXPORT_BUTTON_CLICKED_EVENT:
case PE_FIRST_PAGE_BUTTON_CLICKED_EVENT: case PE_PREVIOUS_PAGE_BUTTON_CLICKED_EVENT: case PE_NEXT_PAGE_BUTTON_CLICKED_EVENT: case PE_LAST_PAGE_BUTTON_CLICKED_EVENT: case PE_CANCEL_BUTTON_CLICKED_EVENT:
case PE_ACTIVATE_PRINT_WINDOW_EVENT: case PE_DEACTIVATE_PRINT_WINDOW_EVENT:
case PE_PRINT_SETUP_BUTTON_CLICKED_EVENT: case PE_REFRESH_BUTTON_CLICKED_EVENT:
{
PEGeneralPrintWindowEventInfo * eventInfo = (PEGeneralPrintWindowEventInfo *) param;
ASSERT(eventInfo != 0 && eventInfo->StructSize == PE_SIZEOF_GENERAL_PRINT_WINDOW_EVENT_INFO);
// TODO
}
break;
case PE_ZOOM_LEVEL_CHANGING_EVENT:
{
PEZoomLevelChangingEventInfo * eventInfo = (PEZoomLevelChangingEventInfo *) param;
ASSERT(eventInfo != 0 && eventInfo->StructSize == PE_SIZEOF_ZOOM_LEVEL_CHANGING_EVENT_INFO);
// TODO
}
break;
Crystal Report Engine |
98 |
case PE_GROUP_TREE_BUTTON_CLICKED_EVENT:
{
PEGroupTreeButtonClickedEventInfo * eventInfo = (PEGroupTreeButtonClickedEventInfo *)param;
ASSERT(eventInfo != 0 && eventInfo->StructSize == PE_SIZEOF_GROUP_TREE_BUTTON_CLICKED_EVENT_INFO);
// TODO
}
break;
case PE_CLOSE_BUTTON_CLICKED_EVENT:
{
PECloseButtonClickedEventInfo *eventInfo = (PECloseButtonClickedEventInfo *)param;
ASSERT(eventInfo != 0 && eventInfo->StructSize == PE_SIZEOF_CLOSE_BUTTON_CLICKED_EVENT_INFO);
// TODO
}
break;
case PE_SEARCH_BUTTON_CLICKED_EVENT:
{
PESearchButtonClickedEventInfo *eventInfo = (PESearchButtonClickedEventInfo *)param;
ASSERT(eventInfo != 0 && eventInfo->StructSize == PE_SIZEOF_SEARCH_BUTTON_CLICKED_EVENT_INFO);
// TODO
}
break;
case PE_SHOW_GROUP_EVENT:
{
PEShowGroupEventInfo * eventInfo = (PEShowGroupEventInfo *)param;
ASSERT(eventInfo != 0 && eventInfo->StructSize == PE_SIZEOF_SHOW_GROUP_EVENT_INFO);
// TODO
}
break;
case PE_DRILL_ON_GROUP_EVENT:
{
PEDrillOnGroupEventInfo * eventInfo =
Crystal Report Engine |
99 |
(PEDrillOnGroupEventInfo *) param; ASSERT(eventInfo != 0 && eventInfo->StructSize == PE_SIZEOF_DRILL_ON_GROUP_EVENT_INFO);
// TODO
}
break;
case PE_DRILL_ON_DETAIL_EVENT:
{
PEDrillOnDetailEventInfo * eventInfo = (PEDrillOnDetailEventInfo *) param;
ASSERT(eventInfo != 0 && eventInfo->StructSize == PE_SIZEOF_DRILL_ON_DETAIL_EVENT_INFO);
// TODO
}
break;
case PE_READING_RECORDS_EVENT:
{
PEReadingRecordsEventInfo * readingRecordsInfo = (PEReadingRecordsEventInfo *) param;
ASSERT(readingRecordsInfo != 0 && readingRecordsInfo->StructSize == PE_SIZEOF_READING_RECORDS_EVENT_INFO);
// TODO
}
break;
case PE_START_EVENT:
{
PEStartEventInfo * startEventInfo = (PEStartEventInfo *) param;
ASSERT(startEventInfo != 0 && startEventInfo->StructSize == PE_SIZEOF_START_EVENT_INFO);
// TODO
}
break;
case PE_STOP_EVENT:
{
PEStopEventInfo * stopEventInfo =
Crystal Report Engine |
100 |
(PEStopEventInfo *) param; ASSERT(stopEventInfo != 0 &&
stopEventInfo->StructSize == PE_SIZEOF_STOP_EVENT_INFO);
// TODO
}
break;
default:
break;
}
return TRUE;
}
//call this function after open a print job
//before call PEStartPrintJob
BOOL initializeEvent(short printJob)
{
//initialize window options
//do not have to set window options to get events,
//however, some of the events are fired only when
//certain window options are on.
PEWindowOptions windowOptions; windowOptions.StructSize = PE_SIZEOF_WINDOW_OPTIONS;
PEGetWindowOptions(printJob, &windowOptions);
windowOptions.hasGroupTree = TRUE; windowOptions.hasSearchButton = TRUE; windowOptions.canDrillDown = TRUE;
if(!PESetWindowOptions(printJob, &windowOptions)) return FALSE;
//enable event.
//by default, events are disabled.
PEEnableEventInfo eventInfo;
eventInfo.StructSize = sizeof(PEEnableEventInfo); eventInfo.activatePrintWindowEvent = PE_UNCHANGED; eventInfo.closePrintWindowEvent = TRUE; eventInfo.startStopEvent = TRUE; eventInfo.printWindowButtonEvent = PE_UNCHANGED; eventInfo.drillEvent = TRUE; eventInfo.readingRecordEvent = TRUE;
Crystal Report Engine |
101 |