Develgde
Develgde
0
Developer’s Reference
Manual written by
Gary Carter, John Morse, Lisa Barry, and Kirsten Sutton
(INSTRUCTIONS, ETC.),1992-1996.
C O N T E N T S
Chapter 1 - Application Development with Crystal Reports
Introduction To The Crystal Report Engine .............................................................2
Before using the Report Engine in your application ................................................3
Using The Crystal Report Engine ............................................................................4
The Crystal Custom Control ...................................................................................5
The Crystal ActiveX Control (OCX) ........................................................................8
The Crystal Visual Component Library for Delphi ................................................11
The Report Engine Class Library ...........................................................................13
The Report Engine API .........................................................................................15
Distributing Report Engine Applications ...............................................................35
Working with subreports ......................................................................................36
Exporting Reports Using the Report Engine API ....................................................37
Special Considerations for Visual Basic users .......................................................40
Additional Sources of Information ........................................................................44
Section Codes ......................................................................................................46
i
CLASS CRPETableType ...................................................................................... 325
CLASS CRPESessionInfo ..................................................................................... 326
CLASS CRPETableLocation ................................................................................ 327
CLASS CRPEPrintOptions ................................................................................... 327
CLASS CRPEExportOptions ................................................................................ 329
CLASS CRPESectionOptions .............................................................................. 333
CLASS CRPEGraphDataInfo ............................................................................... 336
CLASS CRPEGraphTextInfo ................................................................................ 338
CLASS CRPEngine .............................................................................................. 342
CLASS CRPEJob ................................................................................................. 343
Index
ii
1 Application Development with
Crystal Reports
Before you add the Crystal Report Engine to your application, you should
be familiar with some key features of the Report Engine. Review the
following points, and make sure you understand each before attempting
to make calls to the Report Engine from your application.
● The Report Engine outputs existing reports. You can not create report
files using the functionality of the Report Engine. Reports must be
created using the Crystal Reports application described in the Crystal
Reports User’s Guide. Make sure you understand the report creation
process before trying to print reports with the Report Engine.
● The Report Engine provides a convenient add-on to your existing
application development project. With just a few lines of code, you
produce a powerful report writing and distribution tool that would
take thousands of lines of code and weeks to produce otherwise.
● The Report Engine does not require the use of a fixed user interface.
The Report Engine is designed to work with your existing
development project and allows you to define the user interface your
customers and users are familiar with and expect from your
application.
Creating the The interface you develop to allow users to print reports is limited only
by your needs and your imagination. The kind of user interface you select
interface for is unimportant to the Report Engine.
printing the Common methods of using the Report Engine include a single menu
reports command that produces a single report, a dialog box allowing several
options for printing reports, or a completely separate front-end
application that is called by your application. All are acceptable
techniques, and each has its advantages. How you design your user
interface can depend on any or all of the following:
● The purpose of your application.
● The types of reports your application will use.
● The printing options you want to make available with those reports.
● Whether your application will offer only one report or a choice of
several reports.
Consider your application and your reporting needs carefully, and
design a User Interface that will use the Report Engine most efficiently.
Adding the As described earlier in this chapter, there are five different Report Engine
development tools that can be used to add the Crystal Report Engine to
Report Engine your application:
to your ● the Crystal Custom Control,
application ● the Crystal ActiveX Control,
● the Crystal Visual Component Library for Delphi,
The Crystal Custom Control is a VBX file first supported by Visual Basic
3.0. Although this type of add-on control has been replaced by the more
powerful ActiveX control, many development applications, including
Visual Basic 4.0, continue to support VBX controls.
NOTE: The Crystal Custom Control is only available for 16-bit
development environments.
Using the This section illustrates the basic features of the Crystal Custom Control
and how to use the Custom Control in a Visual Basic 4.0 project to add
Custom Control Report Engine functionality.
Once you have the Crystal Custom Control object on your form, you
build the connection between your application and Crystal Reports by
setting the object's properties via the Properties list. Using the properties
list, you specify:
● the name of the report you want to print in response to an application
event,
● the destination for that report (window, file, or printer),
● the number of copies you want to print (if your report is going to the
printer),
● print file information (if your report is going to a file),
● print window sizing and positioning information (if your report is
going to a window),
● selection formula information (if you want to limit the records in your
report), and
● sorting information.
Crystal Custom Control properties can be changed either at design time
or at runtime. Note, however, some properties are available only at
runtime. These properties do not appear on the Properties list in Visual
Basic.
NOTE: For a complete description of each property in the Crystal Custom
Control, refer to the Crystal Reports Developer’s online Help.
Using the Once you have the ActiveX Control object on your form, you build the
connection between your application and Crystal Reports by setting the
ActiveX object's properties at design time or changing properties at runtime. The
Control ActiveX properties let you specify:
● the name of the report you want to print in response to an application
event,
● the destination for that report (window, file, or printer),
● the number of copies you want to print (if your report is going to the
printer),
● print file information (if your report is going to a file),
● print window sizing and positioning information (if your report is
going to a window),
● selection formula information (if you want to limit the records in your
report,
● sorting information, and
● other related properties.
Crystal ActiveX Control properties can be changed either at design time
or at runtime. Note, however, some properties are available only at
runtime. These properties do not appear at design time.
NOTE: For a complete description of each property in the Crystal ActiveX
Control, refer to the Crystal Reports Developer’s online Help.
Adding the VCL The following instructions demonstrate how to add the Crystal VCL to a
Delphi 2.0 project using the INSTALL command on the Component menu.
to your project If you are using Delphi 1.x, use the INSTALL COMPONENTS command on
the Options menu and refer to your Delphi 1.0 documentation for
complete instructions.
1. With your project open in Delphi, choose the INSTALL command
from the Component menu. The Install Components dialog box
appears.
2. Click Add to add a new component to your project. The Add Module
dialog box appears.
3. Click Browse. The Add Module dialog box changes to allow you to
browse through your directories and files to find a component
module.
4. Select Unit file (*.DCU) from the Files of type drop down list box. The
Crystal VCL is a Delphi Unit file.
Using the Once you add the Crpe component to a form in your project, you build
the connection between your Delphi application and the Crystal Report
Crystal VCL Engine by setting the component's properties via the Object Inspector.
Using the Object Inspector, you specify:
● the name of the report you want to print in response to an application
event,
● the destination for that report (window, file, or printer),
● the number of copies you want to print (if your report is going to the
printer),
● print file information (if your report is going to a file),
● print window sizing and positioning information (if your report is
going to a window),
● selection formula information (if you want to limit the records in your
report,
● sorting information, and
● other related properties.
Crpe component properties can be changed either at design time or at
runtime. Note, however, some properties are available only at runtime.
These properties do not appear on the Properties list in the Object
Inspector.
PEPLUS.H
This C++ header file contains the Report Engine class definitions along
with several structure definitions used by the Report Engine classes. You
must #include this file in any code module that will be using the Report
Engine classes.
PEPLUS.CPP
This C++ source code file contains implementations of all of the class
methods for the REC Library classes. This file must be added to your C++
project file in order to use the REC Library. This code is compiled directly
into your Visual C++ project and calls the functions available in the
Crystal Report Engine.
The Report Engine API (REAPI) is the most direct method of adding the
Crystal Report Engine to your application project. The Report Engine
itself is a Windows Dynamic Link Library (DLL), and, therefore, exports
its functionality in the form of DLL functions. These functions make up
the Report Engine API.
The Report Engine DLL, CRPE.DLL (16-bit) or CRPE32.DLL (32-bit), is
installed in your \WINDOWS\SYSTEM directory when you install
Crystal Reports. This assures that the DLL is available to any application
on your system that uses the Report Engine.
NOTE: For complete information on distributing Report Engine and other
runtime DLLs with your application, refer to the Crystal Reports Runtime
Help.
The process for loading a DLL and calling DLL functions is a well
documented aspect of the Windows API. If you are not familiar with
working with DLLs, please refer to Windows API documentation before
attempting to use the Report Engine API. You may also want to consider
one of the other methods described in this chapter for adding the Report
Engine to your application.
The rest of this section assumes an understanding of DLLs and how to use
them in a Windows application. It also assumes a basic understanding of
the C language. The examples here are written in C, and do not cover the
LoadLibrary, GetProcAddress, or FreeLibrary calls.
Many Windows development environments support direct calls to DLL
functions, Visual Basic, Visual dBASE, and Delphi, for example. Refer to
the documentation for your development environment for complete
instructions on using a DLL. Your documentation may also cover
instructions on how to translate C function calls to the language you use.
Study your documentation, then review the steps described here for
using the Report Engine in an application via the REAPI.
Using the The REAPI provides two options for processing and producing reports
from within an application:
Report Engine
● a Print-Only link, and
API
● a Custom-Print link.
The Print-Only link is the fastest, easiest method for producing a report
with the REAPI. A Print-Only link, however, provides a very limited
functionality. It allows a report to be printed on a default printer or
previewed in a window on-screen. It does not allow you to customize a
report in any way before printing it, though.
A Custom-Print link, on the other hand, provides all the report
processing power of Crystal Reports itself. By coding a Custom-Print link
into your application, you can change record selection, record sorting,
group creation, group selecting, group sorting, exporting to disk files, e-
mail, Exchange and Lotus Notes folders, or ODBC data sources, selecting
specific printers for printing, logging on to SQL servers and ODBC data
sources, editing formulas, formatting report sections, and much more. A
Custom-Print link is, however, a more complex process to code than a
Print-Only link.
PEPrintReport Arguments
PEPrintReport is declared in CRPE.H as follows:
short FAR PASCAL PEPrintReport (
char FAR *reportFilePath,
BOOL toDefaultPrinter,
BOOL toWindow, char FAR *title,
int left, int top,
int width, int height,
DWORD style, HWND parentWindow);
Parameter Description
reportFilePath The name of the report to be printed. Include
the path if the report is not in the current
directory. The report name can be hard-coded
and unchangeable at runtime, or you can pass a
string variable or character array as the result of
a user choice.
toDefaultPrinter If toPrinter is set to TRUE (1), the report is sent
to a printer. The toWindow argument should be
set to FALSE.
toWindow If toWindow is set to TRUE (1), the report is
sent to a Preview window. The toPrinter
argument should be set to FALSE.
title The title that you want to appear in the window
title bar. This argument can receive a string
variable or a character array at runtime.
left The position, in screen coordinates, at which
you want the left edge of the Preview window
to appear if the report is being printed to a
window.
top The position, in screen coordinates, at which
you want the top edge of the Preview window
to appear if the report is being printed to a
window.
width The width, in screen coordinates, of your
Preview window, in pixels, if the report is being
printed to a window.
height The height, in screen coordinates, of your
Preview window, in pixels, if the report is being
printed to a window.
style The style setting (as defined in WINDOWS.H).
Style settings can be combined using the bitwise
OR operator. These are standard Windows
styles. Refer to Windows API documentation
for complete information on window styles.
Use 0 for default style settings.
parentWindow Specifies the window handle for the parent
window to be used for this Preview window.
Description
This step starts the Crystal Report Engine and prepares it to accept a print
job. The Report Engine must be open before a print job can be established.
You should open the Report Engine before the user has a chance to try to
print a report. For example, if your application uses a dialog box as the
User Interface to the Report Engine, open the Report Engine immediately
after the dialog box is created at runtime. Your dialog box can allow the
user to establish a print job and make changes to the report while the
Report Engine is already open.
Every time the Report Engine is opened, it should be closed once your
application is finished accessing it (see Close the Report Engine). For
example, if you open the Report Engine when a dialog box is created,
close the Report Engine when that dialog box is destroyed.
Description
When you open a print job, the Report Engine returns a Job Handle for
the print job. This handle is important to identifying the print job in the
rest of your code.
Description
The Report Engine must know where to send the final report. The report
can be printed to a printer, displayed in a Preview window, exported to
a disk file, exported to another database, or exported to an e-mail address.
The example above sends the report to the Preview window.
Although you can choose any of the several destinations for report
output, you must establish a destination for the report to print. You can,
however, write code in your application that allows your users to decide
on a destination themselves.
NOTE: This step does not actually print the report, it only establishes a
destination for the report when printed. The report is actually printed in
Step 4 using the PEStartPrintJob function.
The following functions are available to establish a print destination:
● PEOutputToWindow
Printing a report to a window requires no other print destination code
other than the function itself.
● PEOutputToPrinter
Printing a report to a printer requires no other print destination code
other than the function itself. However, PESelectPrinter can be used to
select a printer other than the default printer at runtime. The
PESelectPrinter function uses the Windows structure DEVMODE. For
more information on this structure, refer to the Windows SDK.
Description
This function actually sends the report to the output device indicated in
Step 3. Once PEStartPrintJob is called, the Report Engine begins
generating the report. The Report Engine displays a dialog box that
indicates the status of the report being generated. If the report is sent to
the Preview window, the window will appear as soon as PEStartPrintJob
is called. The Preview window can be closed by a call to PECloseWindow,
by closing the Report Engine (as in Step 6), or by the user clicking the
Close button. No changes can be made to a print job until it finishes
printing.
Description
Once the print job has completed, it can be closed using PEClosePrintJob.
If you wish to make more changes to the report and print it again, you can
do so before closing the job. However, once your application is finished
with a report, it should close the print job to free up memory in the user’s
system.
Description
This function closes the Report Engine entirely. No other Report Engine
functions relating to print jobs may be called once the Report Engine is
closed. Therefore, you should keep the Report Engine open until it is no
longer needed in your application. For example, if the Report Engine is
accessed through a dialog box in your application, you should wait to
close the Report Engine until the dialog box is exited and destroyed.
Event code
short hJob; // print job handle
BOOL bResult;
hJob = PEOpenPrintJob("C:\\CRW\\ORDER.RPT");
if (!hJob)
{
ReportError(hJob);
return;
}
if (ToWindow)
{
bResult = PEOutputToWindow( hJob,
"My Report", CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, 0, NULL );
}
else
{
bResult = PEOutputToPrinter(hJob, 1);
}
if (!bResult)
{
ReportError(hJob);
PEClosePrintJob(hJob);
return;
}
if (!PEStartPrintJob(hJob, TRUE))
{
ReportError(hJob);
}
PEClosePrintJob(hJob);
return;
Code Evaluation
Event code
The following is an evaluation of the sample event code that appears
above.
short hJob; // print job handle
BOOL bResult;
This section declares two local variables that are important to the
remainder of the code. The variable hJob will receive the handle to the
print job that results from a PEOpenPrintJob call. This handle is required
by most Report Engine functions. bResult will be given a TRUE or FALSE
value as the result of several Report Engine calls. Any time bResult
receives a FALSE value, an error has occurred.
Report Engine Several REAPI functions provide information in the form of a variable
length string value or character array. When your program calls an
API Variable REAPI function that produces a variable-length string, the Report Engine
Length Strings saves the string, creates a string handle which refers to the string, and
returns that handle along with a value indicating the length of the string.
To retrieve the contents of the string, you must call PEGetHandleString.
This approach allows you to allocate a buffer of the exact size needed to
hold the string before obtaining the actual string.
If your development language can not allocate a buffer at runtime, you
should declare a reasonably large buffer. Field names and error messages
will generally be less than 100 bytes, but formulas may be 1000 bytes or
longer. You can control how much data is copied to the buffer when you
call PEGetHandleString.
Here is the procedure to follow when obtaining a variable length string:
1. Call the function which produces the string. This returns the string
handle and length. The length includes all characters in the string
plus a terminating null byte.
2. If necessary, allocate the string buffer.
Sample Code
Use the following C code as an example of how to call a function that
returns a variable length string. The code uses the PEGetNthSortField
function which obtains the name of a field being used to sort the report
and the direction of the sort. There are several other functions that return
variable length strings, but all are handled in a similar fashion.
Examine this code carefully and try to incorporate it into your own
application without modifying the basic procedure. Only experienced
programmers should try making changes to this technique since small
mistakes here can cause major errors in your application. If you expect to
use several REAPI functions that return variable length strings, you may
want to set this code up in a separate function to avoid repetition and
errors.
HANDLE nameHandle;
short nameLength;
short direction;
char *fieldName;
PEGetNthSortField ( printJob, sortFieldN,
&nameHandle, &nameLength,
&direction );
/*allocate fieldName buffer*/
fieldName = (char*)malloc(nameLength);
PEGetHandleString ( nameHandle,
fieldName,
nameLength );
/*
** fieldName now contains name
** of field and nameHandle is no
Code Evaluation
HANDLE nameHandle;
short nameLength;
short direction;
char *fieldName;
Any time you evaluate a function that returns a variable length string,
you will need at least three variables: a handle to the string, a short
integer to hold the length of the string, and a character array or pointer to
a character array. The direction variable in this example will hold the sort
direction and is specific to the PEGetNthSortField function.
It is important to note that although the PEGetNthSortField function is
defined in the Report Engine as accepting a pointer to a handle
(HANDLE*) and a pointer to a short (short*), we do not define
nameHandle and nameLength as pointer variables. Instead, they are
defined simply as a HANDLE and a short integer, then passed to
PEGetNthSortField with the & operator. This technique automatically
initializes the variables with the address of the variable itself. Since the
PEGetNthSortField function requires the address in memory to place the
information, this is the most convenient method to define and pass the
variables.
PEGetNthSortField ( printJob, sortFieldN,
&nameHandle, &nameLength,
&direction );
The PEGetNthSortField function places a handle to the sort field name in
the nameHandle location and the length of the field name (all characters
in the name plus a terminating null byte) in the nameLength location.
These values will be used to extract the actual field name.
/*allocate fieldName buffer*/
fieldName = (char*)malloc(nameLength);
Now that we know the actual length of the field name we are trying to
obtain, we can allocate exactly the right amount of memory to store that
name. The malloc function does this for us.
NOTE: malloc is defined in the C runtime library stdlib.h.
Sample Code There are many topics in the Crystal Reports Developer’s online Help
that provide sample code for using the Report Engine API in C, Visual
Basic, Visual dBASE, and Delphi.
● All topics for individual REAPI functions contain sample calls for
Visual Basic, C, Delphi, and Visual dBASE. (Search for the function by
name in the Crystal Reports Developer’s online Help.)
Other topics that contain useful example code are:
● Establishing a print-only link using PEPrintReport contains sample print-
only link calls for C.
● Coding a custom-print link contains C code which can be modified for a
custom-print link Report Engine call.
● Functions that return variable length strings contains a block of C code
that you can modify and use for calling a function that returns a
variable length string.
Crystal Reports comes with a free runtime license for any application that
uses the Crystal Report Engine through any of the methods described in
this chapter. When distributing a Report Engine application, you must
also distribute several runtime files required by the Report Engine. These
files are listed in the Runtime File Requirements Help. Be sure to carefully
examine this Help file and distribute the appropriate runtime files with
your application. All runtime files are included under the runtime license
agreement unless otherwise stated.
Your application can have much of the same control over subreports that
it has over primary reports. The only exceptions are, you can not open or
close a print job while a subreport is open and you can only work with
report sections that are actually in the subreport. For example subreports
do not have page header sections like primary reports do, so you can not
do anything with a subreport that requires a page header section.
Most Report Engine functions require a print job handle as a parameter.
When you supply the handle to a primary report, the functions act on the
primary report. When you supply the handle to a subreport, the functions
act on the subreport. Getting the handle requires a number of steps.
Opening the You must first open the primary report using the PEOpenPrintJob
function. When you do this, the program returns a handle to the primary
primary report report.
Retrieving an You must then identify the subreport you want to open. You can do that
using the PEGetNSubreportsInSection and PEGetNthSubreportInSection
interim functions. When you run the PEGetNthSubreportInSection function, the
subreport Report Engine returns an interim, double word handle to the subreport
handle you specify.
Retrieving the Once you have the handle, you need to retrieve the name of the
subreport. You do this using the PEGetSubreportInfo function. When you
subreport name run this function, you pass the double word handle as the
subreportHandle argument. The program retrieves the subreport name
as the name member of the PESubreportInfo structure.
Opening the Now that you have the name of the subreport (the name you assigned the
subreport when you created it in Crystal Reports), you need to open the
subreport and subreport. You do this using the PEOpenSubreport function. When you
retrieving the use this function, you pass the name (or pointer to the name, depending
job handle on your development tool) as the subreportName argument. The
program then opens the specified subreport and returns a job handle.
Running other Once you have the job handle, you can run any of the other Report Engine
functions with the subreport, passing the subreport job handle as the
Report Engine printJob argument.
functions.
Where to open/ In a Visual Basic application, you can either open the Crystal Report
Engine when you open your application or when you open a form. As a
close the general rule, it is always best to open the Report Engine when you open
Report Engine the application and close it when you close the application rather than
using Visual opening and closing on a form. Here is why:
Basic API calls ● When you open and close on a form, the Report Engine opens every
time you open the form and closes every time you close the form. If
you print a report, close the form, and later decide to print a report
again, the application has to reopen the Report Engine when you open
the form, creating a time delay while running your application.
● When you open and close on the application, the Report Engine opens
once, when you start the application, and it stays open as long as the
Embedded When you pass a concatenated string from Visual Basic to the Report
Engine (for example, for a record selection formula), it is important that
quotes in Visual the resulting string has the exact syntax that the Report Engine expects.
Basic calls to You should pay special attention to embedded quotes in concatenated
the Report strings because they are often the source of syntax errors.
Engine Some examples follow. The first shows code with a common embedded
quote syntax error and the last two show code using the correct syntax.
Wrong syntax
VBNameVariable$ = "John"
Recselct$ = "{file.Lastname} = " + VBNameVariable$
This code results in the string:
{file.Lastname} = John
Since John is a literal string, the Formula Checker expects to see it
enclosed in quotes. Without the quotes, the syntax is incorrect.
Correct syntax
VBNameVariable$ = "John"
Recselct$ = "{file.Lastname} = " +
(chr$(39) + VBNameVariable + chr$(39)
This code results in the string:
{file.Lastname} = 'John'
which is the correct syntax for use in a Crystal Reports record selection
formula. This is the syntax you would use if you were entering a selection
formula directly into Crystal Reports.
Identifying When you are passing a string to the Report Engine as part of your
custom print link, you may think that you are passing one thing when the
string issues in program, in fact, is passing something entirely different. This can happen
Visual Basic easily, for example, when you are passing a concatenated string that you
links to the have built using variables. A small syntax error (with embedded quotes,
for example) can lead to an error message and a failed call. A simple
Report Engine debugging procedure follows:
Retrieving Although Crystal Custom Control (VBX) and Crystal ActiveX Control
(OCX) properties allow you to control many report writing features in
report data your application, you can not retrieve information about a report using
with Visual these properties. For instance, the SelectionFormula property allows you
Basic to add a record selection formula to a report at runtime, or change the
record selection formula that exists in the report. However, if the report
already contains a selection formula, you can not use the
SelectionFormula property to view that formula at runtime. This applies
to all Custom Control and ActiveX control properties. If you need to view
existing report information at runtime, you must use the Report Engine
API to access the Crystal Report Engine.
Section type
Section Section type
Report Header Section REPORTHDR
Page Header Section PAGEHDR
Group Header Section GROUPHDR
Detail Section DETAIL
Group Footer Section GROUPFTR
Report Footer Section REPORTFTR
Page Footer Section PAGEFTR
If the report contains one or more groups and you are specifying a
group section, use an integer to specify the group of interest (the first
group is Group 0, the second is Group 1, and so forth.)
NOTE: If you are specifying the section code for anything other than
a group section, use 0 for this parameter.
Section If an area contains more than one section, use an integer to specify
the section of interest (the first section in an area is Section 0, the
second is Section 1, and so forth.)
Example section Specifying the only (or the first) section in a non-group
codes area
REPORTHDR.0.0
«The first Report Header section.»
Connect
Logs on to a SQL server or a non-SQL database that is password-
protected (such as a Paradox database).
CopiesToPrinter
Specifies the number of copies to be printed if you are printing to a
printer.
DataFiles
Specifies the location of the database files or tables used in the report.
Destination
Specifies the destination to which your report is to be printed
(Window, Printer, or File).
DetailCopies
Specifies the number of copies of each record in the Details section
that the program is to print.
DialogParentHandle
For a Print window that is an MDI child, specifies the handle for the
parent window.
DiscardSavedData
If data is saved with the specified report, setting this property to 1
(True) discards the data.
EMailMessage
Specifies the message line in your e-mail message.
EMailSubject
Specifies the subject line in your e-mail message.
EMailToList
Specifies the "To" list to which you want your e-mail message directed.
EMailVIMBCCList
Specifies the "Blind CC" list to which you want your e-mail message
copied.
ExchangeFolder
Specifies the Exchange path to export a file, when you want to export
to Microsoft Exchange.
ExchangePassword
Specifies the Exchange password when you want to export to
Microsoft Exchange.
ExchangeProfile
Specifies the Exchange Profile when you want to export to Microsoft
Exchange.
Formulas
Specifies a new string for an existing formula.
GraphData
Sets the data used for a specified graph.
GraphOptions
Sets a number of options for the specified graph.
GraphText
Sets the various text components for the specified graph.
GraphType
Sets the kind of graph used in the selected section in the specified
report.
GroupSelectionFormula
Specifies the groups to be used when printing the report.
GroupSortFields
Specifies the group field(s) that are to be used to sort your data when
the report is printed.
Index
See Visual Basic documentation.
LastErrorNumber
Returns the error code for the last runtime error.
LastErrorString
Returns the error string for the last runtime error.
Left
See Visual Basic documentation.
MarginBottom
Sets the bottom margin for the specified report.
MarginLeft
Sets the left margin for the specified report.
MarginRight
Sets the right margin for the specified report.
MarginTop
Sets the top margin for the specified report.
Name
See Visual Basic documentation.
ParameterFields
Sets parameter field values.
PrintDay
Sets the day component of the print date (if different from the actual
date the report is printed).
PrinterCollation
If you specify more than one copy to be printed (using the
PrinterCopies property. PrinterCollation specifies whether or not the
copies will be collated.
PrinterCopies
Sets the number of report copies to be printed.
PrinterDriver
Sets the name of the printer driver that is to print the report.
PrinterName
Sets the name of the printer that is to print the report.
PrinterPort
Sets the name of the printer port that is to print the report.
PrinterStartPage
Sets the first page to be printed.
PrinterStopPage
Sets the last page to be printed.
PrintFileCharSepQuote
Sets the quote character used to enclose alphanumeric field data
when printing to a file using Character Separated format.
PrintFileCharSepSeparator
Sets the character(s) you want to use to separate the fields when
printing to a file using the Character Separated Value format.
PrintFileLinesPerPage
Indicates the number of lines to be printed before the page break.
PrintFileODBCPassword
Used whenever you want to export in ODBC format, specifies the
Password that you need to connect to the data source.
PrintFileODBCSource
Used whenever you export in ODBC format. Specifies the name of
the data source that you want to export to.
PrintFileODBCTable
Used whenever you want to export in ODBC format, specifies the
name of the table you want to export to in the data source.
PrintFileODBCUser
Used whenever you export in ODBC format, this specifies the User
ID that you need to connect to the data source.
PrintFileType
Specifies the type of the file to which the report is to be printed.
PrintFileUseRptDateFmt
When printing to a file, indicates whether or not the program should
save dates in the same date format (MDY, DMY, etc.) that is used in
the report or instead optimize the dates for the file format you have
selected.
PrintFileUseRptNumberFmt
When printing to a file, indicates whether or not the program should
print numbers in the same format (decimal places, negatives, etc.)
that you have used in the report or instead optimize the numbers for
the file format you have selected.
PrintMonth
Sets the month component of the print date (if different from the
actual date the report is printed).
PrintYear
Sets the year component of the print date (if different from the actual
date the report is printed).
RecordsPrinted
Determines the number of records actually printed.
RecordsRead
Determines the number of records actually read.
RecordsSelected
Determines the number of records selected.
ReportDisplayPage
Indicates which page of a multi-page report is currently being
displayed in the Print window.
ReportFileName
Specifies the report to be printed.
ReportLatestPage
Determines the last page printed in the specified report.
ReportSource
Specifies the report source as a report file, a data control, or a True
Grid data control.
ReportStartPage
Determines the first page printed in the specified report.
SectionFont
Specifies the font for a section.
SectionFormat
Specifies the format for a section.
SectionLineHeight
Specifies the line height for a section.
SectionMinHeight
Sets the minimum section height for the specified report section.
SelectionFormula
Specifies the records to be used when printing the report.
SortFields
Specifies the field(s) that are to be used to sort your data when the
report is printed.
SQLQuery
Sets the SQL query string used by the specified report.
Status
Determines the print status for the specified report.
StoredProcParam
Sets the stored procedure parameters when using a report based on
SQL stored procedures.
Top
See Visual Basic documentation.
UserName
Enters the name given to a user for logging on to a protected Access
.MDB file to obtain data files needed by the report.
WindowBorderStyle
Specifies the type of border for the print window.
WindowControlBox
Specifies whether or not the print window is to have a control
(system menu) box in the upper left hand corner when the report is
printed to a window.
WindowControls
Specifies whether or not the print controls are to appear in the Print
window when printing a report to a window.
WindowHeight
Sets the height of the print window when the report is printed to a
window.
WindowMaxButton
Specifies whether or not the print window is to have a maximize
button when the report is printed to a window.
WindowMinButton
Specifies whether or not the print window is to have a minimize
button when the report is printed to a window.
WindowParentHandle
Specifies the handle of the parent window if the print window is to
be the child of another window.
WindowState
Sets the state of the Print window, normal, minimized, or
maximized, when the report is printed to a Print window.
WindowTitle
Specifies the title you want to appear in the print window title bar
when the report is printed to a window.
WindowTop
Sets the distance, in pixels, that the print window is to appear from
the top edge of the parent window. If the print window is a top level
window, the distance is measured from the top edge of the screen.
WindowWidth
Specifies the width of the print window in pixels.
Usage [form.]Report.Action = 1
For example:
CrystalReport1.Action = 1
«Prints the specified report.»
Availability Runtime
Connect Property
Usage [form.]Report.Connect[=
Name;UserID;Password;DatabaseQualifier$]
For example:
CrystalReport1.Connect = "DSN = Accounting;UID
= 734;PWD = bigboard;DSQ = Administration"
Remarks Enter the parameters necessary to log on to the SQL server that you
need to be activated for your report.
Parameters should be in the following format:
DSN = name;UID = userID;PWD = password;DSQ =
database qualifier
Name is the server name,
userID is the name you have been assigned for logging on to
the SQL server,
password is the password you have been assigned for
logging on to the SQL server, and
database qualifier is the database name if your server uses
the database concept.
NOTE: Before you can use this property for an ODBC/SQL database,
you must install the ODBC/SQL driver for whatever SQL database
you are planning to use, and put the Database/BIN location in your
path.
NOTE: This parameter is required only when it is applicable to the
ODBC/SQL driver you are using.
Remarks The number you enter must not be a zero or a negative value.
DataFiles Property
Description Specifies the location of the database files or tables used in the report.
Usage [form.]Report.DataFiles(ArrayIndex)[=
Location$]
● Enter the file name and path of each database file or table in your
report for which you want to change the location.
● Use a separate line of code for each file for which you want to
change the location.
Availability Runtime
Description Specifies the number of copies of each record in the Details section
that the program is to print.
Remarks If DetailCopies is set to a value less than or equal to zero, the value is
ignored and 1 copy of the Detail section of the report is printed.
DialogParentHandle Property
Description Specifies the handle of the parent window. The program uses this
handle to determine the window within which it centers any dialog
boxes it displays (progress dialog boxes, parameter field prompt
dialog boxes, and so forth).
DiscardSavedData Property
Description If data is saved with the specified report, setting this property to 1
(True) discards the data.
Remarks For TrueFalse% use one of the following values: False = 0, True = 1.
Description Specifies the "CC" list to which you want your e-mail message sent.
EMailMessage Property
Description Specifies the string you want to appear as the body of your e-mail
message.
Usage [form.]Report.EMailMessage[=Message$]
For example:
CrystalReport1.EMailMessage = "The meeting is
at 4:00"
«Sets "The meeting is at 4:00" as the body of the e-mail message.»
EMailSubject Property
Description Specifies the "To" list to which you want your e-mail message
directed.
EMailVIMBCCList Property
Description Specifies the "Blind CC" list to which you want your e-mail message
copied.
ExchangeFolder Property
Description Specifies the Exchange path to export a file, when you want to export
to Microsoft Exchange.
Usage CrystalReport1.ExchangeFolder =
“c:\Microsoft\Exchange\NewRpt.rpt”
«Send the report to file ‘NewRpt’ in subdirectory
\Microsoft\Exchange.»
Availability Runtime
Description Specifies the Exchange Profile when you want to export to Microsoft
Exchange.
Remarks This property is new for version 5.0. Usually your profile is your
name.
Availability Runtime
ExchangePassword Property
Availability Runtime
Formulas Property
Usage [form.]Report.Formulas(ArrayIndex)[=
"FormulaName= FormulaText"]
Enter the formula name and the string that you want to replace the
existing string for each formula that you want to change in your
report.
For example, to change a formula @COMMISSION to
{file.SALES}*.1, and a second formula @TOTAL to {file.SALES} +
{file.COMMISSION}, enter the following:
CrystalReport1.Formulas(0) = "COMMISSION=
{file.SALES} * .1"
CrystalReport1.Formulas(1) = "TOTAL=
{file.SALES} + {file.COMMISSION}"
Availability Runtime
GraphData Property
Usage [form.]Report.GraphData(ArrayIndex%)
[= sectionCode; graphNum; row; col;
field ;direction$]
For example:
CrystalReport1.GraphData(0)= "GH1; 1; GROUP1;
GROUP2; 0; COLANDROW"
«The value in Group 1 is used for the rows of the graph, the value
in Group 2 is used for the columns of the graph, the first
summarized field added to the report is used to set the value of
the risers of the graph, and values in both columns and rows are
used to create the graph.»
Remarks 1. With GraphData, you can specify changes to one or more graphs
at runtime. Those changes then take place sequentially when
you make the "Action=1" call.
The array index value for GraphData simply specifies the
sequence number for the change. Thus:
CrystalReport1.GraphData(0) = "GH1; 3; Group1;
Group2; 666; COLANDROW"
Availability Runtime
GraphOptions Property
Usage [form.]Report.GraphOptions(ArrayIndex%) [=
sectionCode; graphNum; fontFace; barDirection;
labelRisers; gridLines; legend; max; min$]
For example:
CrystalReport1.GraphOptions(0) =
"FOOTER;0;Arial;H;T;F;X;max;min"
«Sets the font to Arial, sets horizontal bars, shows a data value on
every riser (labelRisers = T), and toggles the grid lines off in the
first Graph in the Page Footer section.»
Availability Runtime
Description Sets the various text components for the specified graph.
Usage [form.]Report.GraphText(ArrayIndex%)[=
sectionCode; graphNum;title; subTitle;
footnote;series;group;x;y;z$]
For example:
CrystalReport1.GraphText(0) = "HEADER;
0;;;;;;new x label; new y label;new z label"
«Resets the x, y, and z labels for the first graph in the Page Header
section.»
Remarks 1. Select your section code from the section code table (see Page
46.)
2. With GraphText, you can specify changes to one or more graphs
at runtime. Those changes then take place sequentially when
you make the "Action=1" call. The array index value for
GraphText simply specifies the sequence number for the change.
Thus:
CrystalReport1.GraphText(0) = " GH1; 1; title
string; subtitle string; footnote string;
series string; group string; x string;y string;
z string"
when making changes to one graph only, but
CrystalReport1.GraphText(0) = "TITLE; 1; title
string; subtitle string; footnote string;
series string; group string; x string;y string;
z string"
CrystalReport1.GraphText(1) = "TITLE; 1; title
string; subtitle string; footnote string;
series string; group string; x string;y string;
z string"
when making changes to more than one graph.
3. title, subTitle, footnote, series, group, x, y, and z are the strings you
want to label the appropriate parts of the graph.
Availability Runtime
GraphType Property
Description Sets the kind of graph used in the selected section in the specified
report.
Usage [form.]Report.GraphType(ArrayIndex%) [=
sectionCode; graphNum; graphType$]
For example:
CrystalReport1.GraphType(0)= "GH1; 0; PIE"
«Specifies a Pie graph as the first graph (graphNum =0) in the
Group Header 1 section.»
Availability Runtime
GroupCondition Property
Description Specifies what kind of change in the Group Condition Field will
trigger the creation of a group.
Usage [form.]Report.GroupCondition(SequentialIndex%)
[= group; field; condition; sortDirection$]
Remarks Refer to the following tables for parameter values for this property:
GroupSortFields Property
Description Specifies the group field(s) that are to be used to sort your data when
the report is printed.
Usage [form.]Report.GroupSortFields(ArrayIndex)
[= "+|-GroupField"]
Enter the group field(s) on which you want your report to be sorted.
For example, assume that you have broken your data into state
groups and had Crystal Reports count the number of customers in
each group. In order to print the group with the highest count first,
then the group with the next highest count, etc. (descending order),
enter a string similar to the following:
Availability Runtime
GroupSelectionFormula Property
Usage [form.]Report.GroupSelectionFormula
[= "GroupSelectionFormula"]
Enter the group selection formula just as you would enter it in the
Formula Editor. For example, to limit your report to those groups
with a subtotal on the order details.ORDER AMOUNT field less than
$10,000 (with subtotals triggered by changes in the
customer.CUSTOMER ID field), you would enter the following as a
group selection formula:
Sum ({order details.ORDER AMOUNT},
{customer.CUSTOMER ID}) < $10000
Remarks If your group selection formula includes internal quotes, change all
of the internal double quotes to single quotes and then surround the
entire selection formula in double quotes.
NOTE: If you have created a group selection formula in your report
at Design Time, any group selection formula you enter here will be
appended to that group selection formula, connected by an "and".
Thus, your records will be selected based on a combination of the
two formulas.
LastErrorNumber Property
Description Returns the error code for the last runtime error.
Usage [form.]Report.LastErrorNumber
For example:
'If error occurs, go to Error Handler
ErrorHandler:
MsgBox
CrystalReport1.LastErrorNumber
«If an error occurs, this code calls up a message box that displays
the error number.»
Availability Runtime
Description Returns the error string for the last runtime error.
Usage [form.]Report.LastErrorString
For example:
'If error occurs, go to Error Handler
ErrorHandler:
MsgBox
CrystalReport1.LastErrorString
«If an error occurs, this code calls up a message box that displays
the error string.»
Availability Runtime
MarginBottom Property
Usage [form.]Report.MarginBottom[=MarginSetting%]
MarginLeft Property
Usage [form.]Report.MarginLeft[=MarginSetting%]
For example:
CrystalReport1.MarginLeft = 1440
«Sets a 1 inch left margin for the report (1 inch = 1440 twips).»
Usage [form.]Report.MarginRight[=MarginSetting%]
For example:
CrystalReport1.MarginRight=1440
«Sets a 1 inch right margin for the report (1 inch = 1440 twips).»
MarginTop Property
Usage [form.]Report.MarginTop[=MarginSetting%]
For example:
CrystalReport1.MarginTop = 720
«Sets a 1/2 inch top margin for the report (1 inch = 1440 twips).»
ParameterFields Property
Description Changes the default value of the specified parameter field. When the
prompting dialog box appears for the parameter field, the value you
specify with this property is the value you’re prompted with.
Usage [form.]Report.PParameterFields(ArrayIndex)[ =
"ParameterName;NewValue"]
ParameterFields Property
Description Changes the default value of the specified parameter field. When the
prompting dialog box appears for the parameter field, the value you
specify with this property is the value you’re prompted with.
Usage [form.]Report.PParameterFields(ArrayIndex)[ =
"ParameterName;NewValue"]
Availability Runtime
PrinterCollation Property
Description If you specify more than one copy to be printed (using the
PrinterCopies property), PrinterCollation specifies whether or not
the copies will be collated.
Usage [form.]Report.PrinterCollation[=CollationCode%]
For example:
CrystalReport1.PrinterCollation = 1
«Collates the copies of the specified report.»
Status Code
Uncollated 0
Collated 1
Default Collation 2
PrinterCopies Property
Usage [form.]Report.PrinterCopies[=NumCopies%]
For example:
CrystalReport1.PrinterCopies = 3
«Specifies that the program is to print three (3) copies of the
report.»
Remarks The number used for PrinterCopies must not be zero or a negative
value.
PrinterDriver Property
Description Sets the name of the printer driver that is to print the report.
Remarks The PrinterDriver, PrinterName (see Page 87), and PrinterPort (see
Page 88) properties work together to define the printer that the
report is to be sent to. All three properties must be set in order to
define a new printer. If all three properties are not set, the printer
defined in the report will be used. This may be the user’s default
printer if none has been specified in the report.
PrinterName Property
Description Sets the name of the printer that is to print the report.
PrinterPort Property
Remarks The PrinterDriver (see Page 87), PrinterName (see Page 87), and
PrinterPort properties work together to define the printer that the
report is to be sent to. All three properties must be set in order to
define a new printer. If all three properties are not set, the printer
defined in the report will be used. This may be the user’s default
printer if none has been specified in the report.
PrinterStartPage Property
PrinterStopPage Property
Usage [form.]Report.PrinterStopPage[=StopPage%]
For example:
CrystalReport1.PrinterStopPage = 12
«Specifies that the printing is to end with Page 12 of the report.»
PrintDay Property
Description Sets the day component of the print date (if different from the actual
date the report is printed).
Usage [form.]Report.PrintDay[=Day%]
For example:
CrystalReport1.PrintDay = 23
«Sets 23 as the print day.»
Description Sets the quote character used to enclose alphanumeric field data
when printing to a file using character-separated format.
Usage [form.]Report.PrintFileCharSepQuote[=Quote$]
For example:
CrystalReport1.PrintFileCharSepQuote = "‘"
«Uses the quotation character (‘) to surround values saved in
character-separated format.»
PrintFileCharSepSeparator Property
Description Sets the character(s) you want to use to separate the fields when
printing to a file using the Character Separated Value format.
PrintFileLinesPerPage Property
Description Indicates the number of lines to be printed before the page break. The
default is 60 lines.
Usage CrystalReport1.PrintFileLinesPerPage = 50
«Fifty lines will be printed before a page break.»
Availability Runtime
Description Specifies the name of the file to which the report is to be printed.
Remarks ● You can double-click this property or click the ellipsis (...) in the
Properties box to call up the Choose Print Filename dialog box. In
that dialog box, select the name of the file and the path to which
you want the program to print the report.
● Select a value for this property only if you are printing to a file, if
the value you assigned to the Destination property is 2 - File (see
Destination Property, Page 59).
NOTE: If you want to specify the PrintFileName at runtime, make
certain that you enclose it in quotes in your code.
PrintFileODBCPassword
Description Used whenever you want to export in ODBC format, specifies the
Password that you need to connect to the data source.
Usage [form.]Report.PrintFileODBCPassword[=
Password$]
PrintFileODBCSource
Description Used whenever you export in ODBC format. Specifies the name of
the data source that you want to export to.
Usage [form.]Report.PrintFileODBCSource[=
DataSource$]
For example:
CrystalReport1.PrintFileODBCSource = "pickle"
«’pickle’ is the name of the data source that you want to export
to.»
Description Used whenever you want to export in ODBC format, specifies the
name of the table you want to export to in the data source.
PrintFileODBCUser
Description Used whenever you export in ODBC format, this specifies the User
ID that you need to connect to the data source
PrintFileType Property
Description Specifies the type of print file used when printing a report to a file.
Remarks Select one of the following print file types if you are printing to a file,
if the value you assigned to the Destination property is 2 - File (see
Destination Property, Page 59).
0 - Record
Record style (columns of values). Does not use commas or
separators. Outputs every record with a fixed field width.
1 - Tab separated
Tab separated values. Presents data in tabular form. Encloses
alphanumeric field data in quotes and separates fields with tabs.
2 - Text
Text style. Saves the data in ASCII text format with all values
separated by spaces. This style looks most like the printed page.
3 - DIF
Saves the data in DIF (data interchange format) format. This
format is often used for the transfer of data between different
spreadsheet programs.
4 - CSV
Comma separated values. Encloses alphanumeric field data in
quotes and separates fields with commas.
5 - Character Separated
Saves the data as character separated values in ASCII text format.
15 - RTF
Saves the data in Rich Text Format.
19 - Excel 5
Uses Excel 5 format to save the data in the report.
20 - HTML 3
Uses HTML 3 format to save the data in the report.
22 - HTML Netscape
Uses the Netscape version of HTML to save the data in the report.
23 - HTML Netscape
Saves the data in ASCII text format, broken into pages.
PrintFileUseRptDateFmt Property
Description When printing to a file, indicates whether or not the program should
save dates in the same date format (MDY, DMY, etc.) that is used in
the report or instead, optimize the dates for the file format you have
selected.
Usage [form.]Report.PrintFileUseRptDateFmt[=
TrueFalse%]
For example:
CrystalReport1.PrintFileUseRptDateFmt = 1
PrintFileUseRptNumberFmt Property
Description When printing to a file, indicates whether or not the program should
print numbers in the same format (decimal places, negatives, etc.)
that you have used in the report or instead, optimize the numbers for
the file format you have selected.
Usage [form.]Report.PrintFileUseRptNumberFmt
[=TrueFalse%]
For example:
CrystalReport1.PrintFileUseRptNumberFmt = 1
«Specifies that the program should print numbers in the same
format as used in the report.»
PrintReport Method
Usage [form.]Report.PrintReport
For example:
Result% = CrystalReport1.PrintReport
«Prints the specified report.»
Availability Runtime
Description Sets the month component of the print date (if different from the
actual date the report is printed).
Remarks ● Enter a value from 1-12 where January = 1, and December = 12.
● The PrintYear (see Page 101), PrintMonth, and PrintDay (see Page
90) properties function together. You must change the value of all
three to change the print date. If you do not change all three, the
print date saved with the report is used. This may be the current
date if a specific date is not saved with the report.
PrintYear Property
Description Sets the year component of the print date (if different from the actual
date the report is printed).
Usage [form.]Report.PrintYear[=Year%]
For example:
CrystalReport1.PrintYear = 1994
«Sets the year component of the print date to 1994.»
ProgressDialog Property
Remarks Use this property to indicate whether or not a progress dialog box
should be displayed while the report is printed or exported. This
property is set to True by default.
RecordsPrinted Property
Usage [form.]Report.RecordsPrinted
For example:
Printed& = CrystalReport1.RecordsPrinted
«Fetches the number of records printed and stores it in the Printed
variable.»
Remarks If the report being printed contains one or more group selection
formulas, the value returned by RecordsPrinted (see Page 103)
maybe significantly less than the value returned by RecordsSelected.
Otherwise, this value should equal RecordsSelected (see Page 104).
Availability Runtime
RecordsRead Property
Usage [form.]Report.RecordsRead
For example:
Read% = CrystalReport1.RecordsRead
Remarks If the Crystal Report Engine generates a SQL query to obtain data
from a SQL database when the report is printed, RecordsRead will
only return the number of records received by the Report Engine
from the query. This value may be significantly smaller than the
number of records actually in the SQL database table.
Availability Runtime
RecordsSelected Property
Description Determines the number of records selected for inclusion in the report
out of the total number of records read.
Usage [form.]Report.RecordsSelected
For example:
Selected& = CrystalReport1.RecordsSelected
«Fetches the number of records selected and saves it in the
Selected variable.»
Remarks RecordsSelected will return a value anywhere between zero and the
value returned by RecordsRead (see Page 103). The value returned
by RecordsSelected depends on the queries and selection formulas
set up in the report.
Availability Runtime
ReportDisplayPage Property
Usage [form.]Report.ReportDisplayPage
For example:
Result% = CrystalReport1.ReportDisplayPage
«Fetches the number of the displayed page and stores it in the
Result variable.»
Availability Runtime
ReportFileName Property
ReportLatestPage Property
Usage [form.]Report.ReportLatestPage
For example:
Latest% = CrystalReport1.ReportLatestPage
«Fetches the number of the last page printed and stores it in the
Latest variable.»
Availability Runtime
Description Specifies the source of the report as a report file, a Visual Basic data
control, or a True Grid data control.
Usage CrystalReport1.ReportSource = 3
«Specifies the report source as the Visual Basic data control.»
ReportStartPage Property
Usage [form.]Report.ReportStartPage
For example:
StartPage% = CrystalReport1.ReportStartPage
«Fetches the number of the first page printed and stores it in the
StartPage variable.»
Availability Runtime
Description Sets the font for one or more sections in the specified report.
Usage [form.]Report.SectionFont(SequentialIndex%)[=
sectionCode; fontName; size; italic;
bold;underline;strikethru$]
For example:
CrystalReport1.SectionFont(0)="Footer;Arial;12;
N;N;N;Y"
«Sets the font for the footer section to 12 point, Arial,
strikethrough.»
Remarks With SectionFont, you can specify changes to one or more sections at
runtime. Those changes then take place sequentially when you make
the "Action=1" call.
The array index value for SectionFont simply specifies the sequence
number for the change. Thus:
CrystalReport1.SectionFont(0)=
"DETAIL;Arial;12;N;N;N;Y"
when making changes to the DETAIL section only, but
CrystalReport1.SectionFont(0) =
"HEADER;Arial;12;N;N;N;Y"
CrystalReport1.SectionFont(1) =
"DETAIL;Arial;12;N;N;N;Y"
when making changes to more than one section.
Use the following table as a guide in supplying the required
values for this property:
Availability Runtime
SectionFormat Property
Description Sets the format for one or more sections in the specified report.
Usage [form.]Report.SectionFormat(SectionArrayIndex%)
[= sectionCode; visible; newPageBefore;
newPageAfter; keepTogether;
SuppressBlankSection; resetPageNAfter;
printAtBottomOfPage; underlaySection;
backgroundColor]
For example:
CrystalReport1.SectionFormat(0)=
"GH2;F;X;X;X;X;X;X;X;255.0.0"
«Hides the Group Header 2 section (visible = F) and changes the
background color to red while maintaining default settings for all
other switches.»
Availability Runtime
SectionLineHeight Property
Description Specifies the line height in twips. A twip is 1/1440 inch; there are 20
twips in a point.
Usage [form.]Report.SectionLineHeight(SequentialIndex
%)[=sectionCode; line; height; ascent$]
For example:
CrystalReport1.SectionLineHeight(0) = "GH0; 1;
500; 300"
«Sets the line height for the second line in the group header zero
section to a height of 500 twips with an ascent of 300 twips.»
Availability Runtime
SectionMinHeight Property
Description Sets the minimum section height for the specified report section.
Usage [form.]Report.SectionMinHeight
(SequentialIndex%)[=sectionCode;minHeight$]
Availability Runtime
SelectionFormula Property
Remarks ● Enter the selection formula just as you would enter it in the
Formula Editor in Crystal Reports.
● Make certain that you enclose your selection formula in double
quotes.
● If your selection formula includes internal quotes, for example:
{file.STATE} = "CA"
change all of the internal double quotes to single quotes and then
surround the entire selection formula in double quotes as
follows:
"{file.STATE} = 'CA'"
● If you have created a selection formula in your report at Design
Time, any selection formula you enter here will be appended to
that selection formula. Thus, your records will be selected based
on a combination of the two selection formulas.
SessionHandle Property
Description Sets the session handle for a user once the UserName and Password
properties have opened an Access .mdb file for use by the report.
Remarks If you have already opened a Jet session in your Visual Basic
application, you can set this property to be the current session
handle. Otherwise, you will have to use the Password and
UserName properties to establish the Jet session.
For example:
CrystalReport1.SessionHandle = Current-
SessionHandle
«Sets the session handle to the session handle returned elsewhere
in the application and stored in the variable
CurrentSessionHandle.»
Availability Runtime
SortFields Property
Description Specifies the field(s) that are to be used to sort your data when the
report is printed.
Availability Runtime
Description Sets the SQL query string used by the specified report.
Usage [form.]Report.SQLQuery[=SQLQuery$]
For example:
CrystalReport1.SQLQuery = "SELECT
authors.au_id, authors.au_lname,
authors.au_fname FROM pubs2.dbo.authors
authors WHERE authors.au_lname > ‘Madison’"
«Queries the SQL database to return only the records where the
authors last name falls after Madison alphabetically.»
Remarks ● You may only change the WHERE, FROM and ORDER BY
sections of an SQL query. Although the property requires that
you enter the entire SQL query, the SELECT section must not be
different from the original query in the report.
● To change the ORDER BY clause, you must place a carriage
return and linefeed characters after the WHERE clause and before
the ORDER BY clause in this way:
Report1.SQLQuery="SELECT...FROM...WHERE..." +
CHR$(13) + CHR$(10) + "ORDER BY..."
● This property is active only if you are using an SQL or ODBC data
source in your report.
Usage [form.]Report.Status
For example:
Status% = CrystalReport1.Status
«Fetches the print status and saves it to the Status variable.»
Remarks The Status property will return one of the following values:
● 0 - The report has not been printed or has not finished printing.
● 3 - The report has finished printing.
● 5 - The report has been cancelled by the user.
Availability Runtime
StoredProcParam Property
Description Sets the stored procedure parameters when using a report based on
SQL stored procedures.
Availability Runtime
UserName Property
Description Enters the name given to a user for logging on to a protected Access
.MDB file to obtain data files needed by the report.
Availability Runtime
WindowBorderStyle Property
Remarks Select one of the following border styles for the print window:
● 0 = None (creates a window with no border).
● 1 = Fixed Single (creates a window of a fixed size with a single
line border).
● 2 = Sizeable (creates a window that can be resized by the user).
● 3 = Fixed Double (creates a window of fixed size with a double
line border).
Select a value here only if you are printing to a window, if
Destination = 0 (see Destination Property, Page 59).
Remarks ● Select True if you want the window to contain a control box.
Select False if you do not.
● Select a value here only if you are printing to a window, if
Destination = 0 (see Destination Property, Page 59).
WindowControls Property
Description Specifies whether or not the print controls are to appear in the print
window when printing a report to a window.
Usage [form.]Report.WindowControls[={True|False}]
For example:
CrystalReport1.WindowControls = True
«Specifies that print controls are to appear in the print window.»
WindowHeight Property
Description Sets the height of the print window when the report is printed to a
window.
Remarks ● If you are not satisfied with the default settings, enter the external
height you want for your print window in pixels. (A standard
VGA monitor is 640 x 480 pixels.)
● Select a value here only if you are printing to a window, if
Destination = 0 (see Destination Property, Page 59).
WindowLeft Property
Description Sets the distance, in, that the print window is to appear from the left
edge of the parent window. If the print window is a top level
window, then the distance is measured from the left edge of the
screen. (A standard VGA monitor is 640 x 480 pixels.)
Remarks ● If you are not satisfied with the default settings, enter the number
of pixels you want between the left edge of the screen and the left
edge of your window.
● Select a value here only if you are printing to a window, if
Destination = 0 (see Destination Property, Page 59).
WindowMaxButton Property
Remarks ● Select True if you want the window to contain a maximize button.
Select False if you do not.
● Select a value here only if you are printing to a window, if
Destination = 0 (see Destination Property, Page 59).
WindowMinButton Property
Remarks ● Select True if you want the window to contain a minimize button.
Select False if you do not.
● Select a value here only if you are printing to a window, if
Destination = 0 (see Destination Property, Page 59).
WindowParentHandle Property
Description Specifies the handle of the parent window if the print window is to
be the child of another window.
Usage [form.]Report.WindowParentHandle[=
ParentHandle%]
For example:
CrystalReport1.WindowParentHandle = Form1.hWnd
«Sets the WindowParentHandle to the handle of Form1. This
specifies that the print window is to be a child of Form1.»
Availability Runtime
Description Specifies the title you want to appear in the print window title bar
when the report is printed to a window.
WindowTop Property
Description Sets the distance, in pixels, that the print window is to appear from
the top edge of the parent window. If the print window is a top level
window, then the distance is measured from the top edge of the
screen.
Remarks ● If you are not satisfied with the default setting, enter the number
of pixels you want between the top of the screen and the top of
your window.
● Select a value here only if you are printing to a window, if
Destination = 0 (see Destination Property, Page 59).
WindowWidth Property
Remarks ● If you are not satisfied with the default setting, enter the external
width of your window, in pixels.
● Select a value here only if you are printing to a window, if
Destination = 0 (see Destination Property, Page 59).
PageCount
Returns the number of pages in the report.
PageFirst
Displays the first page of the report in the print window.
PageLast
Displays the last page of the report in the print window.
PageNext
Displays the next page of the report in the print window.
PagePrevious
Displays the previous page of the report in the print window.
PageShow
Displays a specific page of the report in the print window.
PageZoom
Sets the magnification factor for the report in the print window to a
value from 25% to 400% of the actual size.
PrinterSelect
Displays the Printer Selection common dialog box which enables the
user to specify a different printer.
PrintReport
Triggers the printing of the report.
Usage [form.]Report.PageCount
For example:
NumberofPages = CrystalReport1.PageCount
Remarks PageCount must be called after the Action property to get a valid
page count.
PageFirst Method
Usage [form.]Report.PageFirst
For example:
CrystalReport1.PageFirst
Remarks This method is only valid when the report is printed to a Preview
window.
This method must be called after the Action property.
PageLast Method
Usage [form.]Report.PageLast
For example:
CrystalReport1.PageLast
PageNext Method
Usage [form.]Report.PageNext
For example:
CrystalReport1.PageNext
Remarks This method is only valid when the report is printed to a Preview
window.
This method must be called after the Action property.
PagePrevious Method
Usage [form.]Report.PagePrevious
For example:
CrystalReport1.PagePrevious
Remarks This method is only valid when the report is printed to a Preview
window.
This method must be called after the Action property.
PageShow Method
Remarks This method is only valid when the report is printed to a Preview
window.
This method must be called after the Action property.
Description Sets the magnification factor for the report in the print window to a
value from 25% to 400% of the actual size.
Remarks This method is only valid when the report is printed to a Preview
window.
This method must be called after the Action property.
PrinterSelect Method
Description Displays the Printer Selection common dialog box which enables the
user to specify a different printer.
Usage [form.]Report.PrinterSelect
For example:
CrystalReport1.PrinterSelect
Remarks This method allows you to pick the printer used for printing the
report; this is only valid when reports are printed to a printer.
TCrpePrinterSetup Class
Unit
UCrpe
Description
Usage [form.]Report.Action:=1;
For example:
Crpe1.Action := 1;
«Prints the specified report.»
Availability Runtime
Connect Property
Usage [form.]Report.Connect[:=
Name;UserID;Password;DatabaseQualifier];
For example:
Crpe1.Connect := ‘DSN=Accounting; UID=734;
PWD=bigboard; DSQ=Administration’;
«Connects to the "Administration" database on the "Accounting"
server using the user ID #734 and the password "bigboard".»
CopiesToPrinter Property
Usage [form.]Report.CopiesToPrinter[:=NumCopies];
For example:
Crpe1.CopiesToPrinter := 3;
«Prints three copies of the specified report.»
Remarks The number you enter must not be a zero or a negative value.
DataFiles Property
Description Specifies the location of the database files or tables used in the report.
Usage [form.]Report.DataFiles(ArrayIndex)[:=Location];
● Enter the file name and path of each database file or table in your
report for which you want to change the location.
● Use a separate line of code for each file for which you want to
change the location.
● The order of files in the array must conform to the order of files in
the report. (You can use Database|Set Location to determine the
order of files in the report.)
● The first file in the report is array index [0], the second file is [1],
etc.
For example, to change the location of the first and third files in a
report (first.dbf and third.dbf) to the c:\new directory, use the
following syntax:
Crpe1.DataFiles[0] := ‘c:\new\first.dbf’;
Crpe1.DataFiles[2] := ‘c:\new\third.dbf’;
Availability Runtime
Related Topics
Resetting Array Properties 207
Access Notes Sparse Array Properties 208
DataFilesLocation Property
Description This property is used to set the directory location of the data files at
Runtime.
Use this property when the location of the data files is different than
the report and that all the tables are in the same location.
Usage [form.]Report.DataFilesLocation[:=Location];
For example:
CRPE1.DataFilesLocation:=‘C:\Account’;
«Sets the database location for the whole report.»
Remarks Using this property overrides any changes you make using the
DataFiles[x] property.
This property requires that the table name be the same as
development.
Availability Runtime
Destination Property
DetailCopies Property
Description Specifies the number of copies of each record in the Details section
that the program is to print.
Remarks If DetailCopies is set to a value less than or equal to zero, the value is
ignored and 1 copy of the Detail section of the report is printed.
DialogParentHandle Property
Description Specifies the handle of the parent window. The program uses this
handle to determine the window within which it centers any dialog
boxes it displays (progress dialog boxes, parameter field prompt
dialog boxes, and so forth).
Remarks Does not affect the placement of the Print Window. Print Window
placement is determined by the WindowLeft, WindowTop,
WindowHeight, and WindowWidth properties.
Description If data is saved with the specified report, setting this property to True
discards the data.
Usage [form.]Report.DiscardSavedData[:={True|False}];
For example:
Crpe1.DiscardSavedData := True;
«Discards the data saved with the specified report.»
EMailCCList Property
Description Specifies the "CC" list to which you want your e-mail message sent.
Usage [form.]Report.EMailCCList[:=CCList];
For example:
Crpe1.EMailCCList := ‘John Brown; Jane Doe’;
«Sends a CC of the e-mail message to both John Brown and Jane
Doe.»
Description Specifies the string you want to appear as the body of your e-mail
message.
Usage [form.]Report.EMailMessage[:=Message];
For example:
Crpe1.EMailMessage := ‘The meeting is at 4:00’;
«Sets "The meeting is at 4:00" as the body of the e-mail message.»
EMailSubject Property
Usage [form.]Report.EMailSubject[:=Subject];
For example:
Crpe1.EMailSubject := ‘Staff meeting’;
«Sets "Staff meeting" as the subject line in an e-mail message.»
Description Specifies the "To" list to which you want your e-mail message
directed.
Usage [form.]Report.EMailToList[:=ToList];
For example:
Crpe1.EMailToList := ‘Jane Doe’;
«Makes "Jane Doe" the only name in the "To" list.»
EMailVIMBCCList Property
Description Specifies the "Blind CC" list to which you want your e-mail message
copied.
Usage [form.]Report.EMailVIMBCCList[:=BCCList];
For example:
Crpe1.EMailVIMBCCList := ‘John Jacobs;Jane
Doe’;
«Makes "John Jacobs" and "Jane Doe" the names for the BCC list.»
UserPrinterSetup.Enabled Property
Usage [form.]Report.UserPrinterSetup.Enabled[:={True|
False}];
For example:
Crpe1.UserPrinterSetup.Enabled:=True;
«Allows the printer settings to be prompted for by the printer
dialog box.»
Remarks Will prompt using a printer dialog when the execute command is
issued.
Execute Property
Usage [form.]Report.Execute;
For example:
Crpe1.Execute;
Availability Runtime
Formulas Property
Usage [form.]Report.Formulas(ArrayIndex)
[:="FormulaName=FormulaText"];
Enter the formula name and the string that you want to replace the
existing string for each formula that you want to change in your
report.
For example, to change a formula @COMMISSION to
{file.SALES}*.1, and a second formula @TOTAL to {file.SALES} +
{file.COMMISSION}, enter the following:
Crpe1.Formulas[0] := ‘COMMISSION={file.SALES}
* .1’;
Crpe1.Formulas[1] := ‘TOTAL={file.SALES} +
{file.COMMISSION}’;
Availability Runtime
Related Topics
Resetting Array Properties 207
GraphOptions Property
Usage [form.]Report.GraphOptions[ArrayIndex]
[:=‘sectionCode; graphNum; fontFace;
barDirection; labelRisers; gridLines; legend;
max; min’];
For example:
Crpe1.GraphOptions[0] :=
‘Title;0;Arial;V;T;F;F;10;5’;
«Sets the font to Arial, sets vertical bars, shows a data value on
every riser (labelRisers = T), and toggles the grid lines off in the
first Graph in the Title section, turns Legend off with a maximum
of 10 and a minimum of 5 on the Y axis.»
Availability Runtime
Related Topics
Resetting Array Properties 207
GraphText Property
Description Sets the various text components for the specified graph.
Usage [form.]Report.GraphText(ArrayIndex)
[:=sectionCode; graphNum; title; subTitle;
footnote; series; group; x; y; z];
For example:
Crpe1.GraphText[0] := ‘HEADER; 0;;;;;;new x
label; new y label;new z label’;
«Resets the x, y, and z labels for the first graph in the Page Header
section.»
Remarks 1. Select your section code from the section code table (see Page
46).
2. With GraphText, you can specify changes to one or more graphs
at runtime. Those changes then take place sequentially when
you make the "Action := 1" call (see Action Property, Page 135).
Availability Runtime
Related Topics
Resetting Array Properties 207
GraphType Property
Description Sets the kind of graph used in the selected section in the specified
report.
Usage [form.]Report.GraphType(ArrayIndex)
[:=sectionCode; graphNum; graphType];
For example:
Crpe1.GraphType[0] := ‘GH1; 0; PIE’;
«Specifies a Pie graph as the first graph (graphNum :=0) in the
Group Header 1 section.»
Availability Runtime
GroupCondition Property
Description Specifies what kind of change in the Group Condition Field will
trigger the creation of a group.
Usage [form.]Report.GroupCondition(SequentialIndex)
[:= group;field;condition;sortDirection];
For example:
Crpe1.GroupCondition[0] :=
‘GROUP1;{header.ORDERNUM};ANYCHANGE;A’;
«Specifies that any change in the ordernum field in Group1 will
trigger a new grouping.»
Remarks Refer to the following tables for parameter values for this property:
Related Topics
Resetting Array Properties 207
GroupSelectionFormula Property
Usage [form.]Report.GroupSelectionFormula(Sequential
Index) [:= GroupSelectionFormula];
Enter the group selection formula just as you would enter it in the
Formula Editor.
Remarks If your group selection formula includes internal quotes, change all
of the internal double quotes to single quotes and then surround the
entire selection formula in double quotes.
NOTE: If you have created a group selection formula in your report
at design time, any group selection formula you enter here will be
appended to that group selection formula, connected by an "and".
Thus, your records will be selected based on a combination of the
two formulas.
Related Topics
Resetting TCrpe String Properties 208
GroupSortFields Property
Description Specifies the group field(s) that are to be used to sort your data when
the report is printed.
Usage [form.]Report.GroupSortFields(ArrayIndex)
[:="{+|-}GroupField"];
Enter the group field(s) on which you want your report to be sorted.
For example, assume that you have broken your data into state
groups and had Crystal Reports count the number of customers in
each group. In order to print the group with the highest count first,
then the group with the next highest count, etc. (descending order),
enter a string similar to the following:
Availability Runtime
Related Topics
Resetting Array Properties 207
LastErrorNumber Property
Description Returns the error code for the last runtime error.
Usage [form.]Report.LastErrorNumber;
For example:
ShowMessage (IntToStr(Crpe1.LastErrorNumber));
«If an error occurs, this code stores the error code as a number.»
Availability Runtime
LastErrorString Property
Description Returns the error string for the last runtime error.
Availability Runtime
MarginBottom Property
Usage [form.]Report.MarginBottom[:=MarginSetting];
For example:
Crpe1.MarginBottom := 720;
«Sets a 1/2 inch bottom margin for the report (1 inch = 1440
twips).»
Usage [form.]Report.MarginLeft[:=MarginSetting];
For example:
Crpe1.MarginLeft := 1440;
«Sets a 1 inch left margin for the report (1 inch = 1440 twips).»
MarginRight Property
Usage [form.]Report.MarginRight[:=MarginSetting];
For example:
Crpe1.MarginRight := 1440;
«Sets a 1 inch right margin for the report (1 inch = 1440 twips).»
Usage [form.]Report.MarginTop[:=MarginSetting];
For example:
Crpe1.MarginTop := 720;
«Sets a 1/2 inch top margin for the report (1 inch = 1440 twips).»
MDIChild Property
Description This property is used to make the print window a child of the current
form.
Usage [form.]Report.MDIChild[:={True|False}]
For example:
Crpe1.MDIChild := True;
Remarks Make sure that the forms FormStyle property is set to fsMDIForm
when you set MDIChild to True.
Usage [form.]Report.Password[:=Password];
For example:
Crpe1.Password := ‘dogsncats’;
«Enters the password dogsncats.»
Availability Runtime
PrinterCollation Property
Description If you specify more than one copy to be printed (using the
PrinterCopies property, see Page 160), PrinterCollation specifies
whether or not the copies will be collated.
Usage [form.]Report.PrinterCollation[:=TCollation];
For example:
Crpe1.PrinterCollation := Collated;
«Collates the copies of the specified report.»
Usage [form.]Report.PrinterCopies[:=NumCopies];
For example:
Crpe1.PrinterCopies := 3;
«Specifies that the program is to print three (3) copies of the
report.»
Remarks The number you use for PrinterCopies must not be zero or a negative
value.
PrinterDriver Property
Description Sets the name of the printer driver that is to print the report.
PrinterMode Property
Description Allows you to set the MS Device Mode for a report (orientation,
paper size, etc.)
PrinterName Property
Description Sets the name of the printer that is to print the report.
Usage [form.]Report.PrinterName[:=PrinterName];
For example:
Procedure TForm1.Button1.Click(Sender:
TObject);
var
lpPrinter, lpDriver, lpPort : pChar;
hMode : Thandle;
begin
lpPrinter := StrAlloc(255);
try
lpDriver := StrAlloc(255);
try
lpPort := StrAlloc(255);
try
Cancel := not
PrintDialog1.Execute;
Printer.GetPrinter(lpPrinter,
lpDriver, lpPort,
hMode);
Crpe1.PrinterName :=
StrPas(lpPrinter);
Crpe1.PrinterDriver :=
StrPas(lpDriver);
Crpe1.PrinterPort := StrPas(lpPort);
Crpe1.PrinterMode := hMode;
finally
StrDispose(lpPort);
end;
finally
StrDispose(lpDriver);
end;
PrinterPort Property
Usage [form.]Report.PrinterPort[:=PortName];
For example:
Procedure TForm1.Button1.Click(Sender:
TObject);
var
lpPrinter, lpDriver, lpPort : pChar;
hMode : Thandle;
begin
lpPrinter := StrAlloc(255);
try
lpDriver := StrAlloc(255);
try
lpPort := StrAlloc(255);
try
Cancel := not
PrintDialog1.Execute;
Printer.GetPrinter(lpPrinter,
lpDriver, lpPort,
PrinterStartPage Property
Usage [form.]Report.PrinterStartPage[:=StartPage];
For example:
Crpe1.PrinterStartPage := 7;
«Specifies that printing is to begin with Page 7 of the report.»
PrinterStopPage Property
Usage [form.]Report.PrinterStopPage[:=StopPage];
For example:
Crpe1.PrinterStopPage := 12;
«Specifies that the printing is to end with Page 12 of the report.»
PrintControls Property
Usage [form.]Report.PrintControls[:={True|False}];
For example:
Crpe1.PrintControls:=True;
Availability Runtime
PrintDay Property
Description Sets the day component of the print date (if different from the actual
date the report is printed).
Usage [form.]Report.PrintDay[:=Day];
For example:
Crpe1.PrintDay := 23;
«Sets 23 as the print day.»
Usage [form.]Report.PrintEnded;
For example:
Crpe1.Destination := toPrinter;
Crpe1.Execute
While Not Crpe1.PrintEnded Do
Application.ProcessMessages;
Close;
«Runs report to printer. Will not allow the program to close the
current form until the print is finished.»
Remarks When destination is to Window, this property will not return true
until you have gone to the last page of the report.
Availability Runtime
PrintFileCharSepQuote Property
Description Sets the quote character used to enclose alphanumeric field data
when printing to a file using character-separated export format.
Usage [form.]Report.PrintFileCharSepQuote[:=Quote];
For example:
Crpe1.PrintFileCharSepQuote := ‘”’;
«Uses the quotation character (“) to surround values saved in
character-separated export format.»
PrintFileCharSepSeparator Property
Description Sets the character(s) you want to use to separate the fields when
printing to a file using the Character Separated Value format.
Usage [form.]Report.PrintFileCharSepSeparator[:=
Separator];
For example:
Crpe1.PrintFileCharSepSeparator := ‘@’;
«Specifies that the "@" character is to be used for separating field
values.»
Description Specifies the name of the file to which the report is to be printed.
Usage [form.]Report.PrintFileName[:=FileName];
For example:
Crpe1.PrintFileName := ‘c:\crw\cust_rpt.txt’;
«Prints the report to a file named "cust_rpt.txt" in the C:\CRW
directory.»
Remarks ● You can double-click this property or click the ellipsis (...) in the
Settings box to call up the Choose Print Filename dialog box. In
that dialog box, select the name of the file and the path to which
you want the program to print the report.
● Select a value for this property only if you are printing to a file, if
the value you assigned to the Destination property is toFile (see
Destination Property, Page 138).
NOTE: If you want to specify the PrintFileName at runtime, make
certain that you enclose it in quotes in your code.
PrintFileType Property
Description Specifies the type of print file used when printing a report to a file.
Usage [form.]Report.PrintFileType[:=FileType];
For example:
Crpe1.PrintFileType := TabSeparated;
«Prints the report to a file in a tab separated format.»
Records
Record style (columns of values). Does not use commas or
separators. Outputs every record with a fixed field width.
TabSeparated
Tab separated values. Presents data in tabular form. Encloses
alphanumeric field data in quotes and separates fields with tabs.
Ascii
Text style. Saves the data in ASCII text format with all values
separated by spaces. This style looks most like the printed page.
DIF
Saves the data in DIF (data interchange format) format. This format
is often used for the transfer of data between different spreadsheet
programs.
CSV
Comma separated values. Encloses alphanumeric field data in
quotes and separates fields with commas.
CharacterSeparated
Saves the data as character separated values in ASCII text format. All
values are separated by a character or characters specified by the
PrintFileCharSepSeparator property (see Page 91).
TabSeparatedText
Saves the data in ASCII text format with all values separated by tabs.
CrystalReportsRPT
Standard Crystal Reports RPT format is used. Most often used for
sending the report to another user via e-mail.
Excel2
Exports the report as a Microsoft Excel 2.1 Worksheet.
Excel3
Exports the report as a Microsoft Excel 3.0 Worksheet.
LotusWK1
Exports the report as a Lotus 1-2-3 WK1 format worksheet.
LotusWK3
Exports the report as a Lotus 1-2-3 WK3 format worksheet.
LotusWKS
Exports the report as a Lotus 1-2-3 WKS format worksheet.
QuattroPro5
Exports the report as a Quattro Pro 5.0 WB1 format file.
RTF
Saves the data in Rich Text Format.
WordForDOS
Uses the Microsoft Word for DOS format to save the data in the
report.
WordForWindows
Uses the Microsoft Word for Windows format to save the data in the
report.
WordPerfect
Uses WordPerfect format to save the data in the report.
Description When printing to a file, indicates whether or not the program should
save dates in the same date format (MDY, DMY, etc.) that is used in
the report or instead, optimize the dates for the file format you have
selected.
Usage [form.]Report.PrintFileUseRptDateFmt
[:={True|False}];
For example:
Crpe1.PrintFileUseRptDateFmt := True;
«Specifies that the program should print dates in the same format
as used in the report.»
PrintFileUseRptNumberFmt Property
Description When printing to a file, indicates whether or not the program should
print numbers in the same format (decimal places, negatives, etc.)
that you have used in the report or instead, optimize the numbers for
the file format you have selected.
Usage [form.]Report.PrintFileUseRptNumberFmt[:={True|
False}];
PrintMonth Property
Description Sets the month component of the print date (if different from the
actual date the report is printed).
Usage [form.]Report.PrintMonth[:=Month];
For example:
Crpe1.PrintMonth := 7;
«Sets July as the print month.»
Description Sets the year component of the print date (if different from the actual
date the report is printed).
Usage [form.]Report.PrintYear[:=Year];
For example:
Crpe1.PrintYear := 1994;
«Sets the year component of the print date to 1994.»
ProgressDialog Property
RecordsPrinted Property
Usage [form.]Report.RecordsPrinted;
For example:
Printed := Crpe1.RecordsPrinted;
«Fetches the number of records printed and stores it in the Printed
variable.»
Remarks If the report being printed contains one or more group selection
formulas, the value returned by RecordsPrinted maybe significantly
less than the value returned by the RecordsSelected property (see
Page 177). Otherwise, this value should equal RecordsSelected.
Availability Runtime
RecordsRead Property
Description Specifies the number of records actually processed by the print job
process.
Usage [form.]Report.RecordsRead;
Availability Runtime
RecordsSelected Property
Description Determines the number of records selected for inclusion in the report
out of the total number of records read.
Usage [form.]Report.RecordsSelected;
For example:
Selected := Crpe1.RecordsSelected;
«Fetches the number of records selected and saves it in the
Selected variable.»
Remarks RecordsSelected will return a value anywhere between zero and the
value returned by the RecordsRead property. The value returned by
RecordsSelected depends on the queries and selection formulas set
up in the report.
Availability Runtime
ReportDisplayPage Property
Usage [form.]Report.ReportDisplayPage;
Availability Runtime
ReportLatestPage Property
Usage [form.]Report.ReportLatestPage;
For example:
Latest := Crpe1.ReportLatestPage;
«Fetches the number of the last page printed and stores it in the Latest
variable.»
Availability Runtime
ReportName Property
Usage [form.]Report.ReportName[:=ReportName];
For example:
Crpe1.ReportName := ‘c:\crw\company.rpt’;
«Prints the report named "company.rpt" that is located in the
C:\CRW directory.»
ReportPrinterSetup Property
Usage [form.]Report.UserPrinterSetup.Enabled
[:= {True|False}];
[form.]Report.UserPrinterSetup.ReportPrinterSetup
[:=[TReportPrinterSetup]];
For example:
Crpe1.UserPrinterSetup.Enabled := True;
Crpe1.UserPrinterSetup.ReportPrinterSetup :=
[rsOrientation];
«Preserves the orientation saved in the report.»
Usage [form.]Report.ReportStartPage;
For example:
StartPage := Crpe1.ReportStartPage;
«Fetches the number of the first page printed and stores it in the
StartPage variable.»
Availability Runtime
ReportTitle Property
Description Sets a report title that supplements the DOS report name at design
time or runtime.
Usage [form.]Report.ReportTitle[:=Title];
For example:
Crpe1.ReportTitle := ‘Monthly Sales Report’;
«Sets the report title to be Monthly Sales Report.»
Remarks The value of the ReportTitle is not displayed in any part of the report,
but is provided for your own use.
Description Sets the font for one or more sections in the specified report.
Usage [form.]Report.SectionFont(SequentialIndex)
[:=sectionCode; fontName; size; italic; bold;
underline; strikethru];
For example:
Crpe1.SectionFont[0] :=
‘Footer;Arial;12;N;N;N;Y’;
«Sets the font for the footer section to 12 point, Arial, strikethrough.»
Remarks With SectionFont, you can specify changes to one or more sections at
runtime. Those changes then take place sequentially when you make
the "Action := 1" call (see Action Property, Page 135). The array index
value for SectionFont simply specifies the sequence number for the
change. Thus:
Crpe1.SectionFont[0] :=
‘DETAIL;Arial;12;N;N;N;Y’;
when making changes to the DETAIL section only, but
Crpe1.SectionFont[0] :=
‘HEADER;Arial;12;N;N;N;Y’;
Crpe1.SectionFont[1] :=
‘DETAIL;Arial;12;N;N;N;Y’;
when making changes to more than one section.
Use the following table as a guide in supplying the required values
for this property:
Availability Runtime
Related Topics
Resetting Array Properties 207
SectionFormat Property
Description Sets the format for one or more sections in the specified report.
Usage [form.]Report.SectionFormat(SectionArrayIndex)[
:=sectionCode; visible; newPageBefore;
newPageAfter; keepTogether; suppressBlank;
resetPageNAfter; printAtPageBottom;
backgroundColor; underlay];
For example:
Crpe1.SectionFormat[0]:=‘GH2;F;X;X;X;X;X;255.0.
0;X’;
«Hides the Group Header 2 section (visible = F) and changes the
background color to red while maintaining default settings for all
other switches.»
Availability Runtime
Related Topics
Resetting Array Properties 207
SectionLineHeight Property
Description Specifies the line height in twips. A twip is 1/1440 inch; there are 20
twips in a point.
Usage [form.]Report.SectionLineHeight(SequentialIndex)
[:=sectionCode; line; height; ascent];
For example:
Crpe1.SectionLineHeight[0] := ‘GH0; 1; 500; 300’;
«Sets the line height for the second line in the group header zero
section to a height of 500 twips with an ascent of 300 twips.»
Availability Runtime
Related Topics
Resetting Array Properties 207
SectionMinHeight Property
Description Sets the minimum section height for the specified report section.
Availability Runtime
Related Topics
Resetting Array Properties 207
SelectionFormula Property
Description Specifies the records to be used when printing the report. Whatever
is set in this property gets appended to the original Selection
Formula in the report. It will AND whatever is set to the original
Selection Formula in the report.
Usage [form.]Report.SelectionFormula(SequentialIndex)
[:=SelectionFormula];
Enter the selection formula just as you would enter it in the Formula
Editor in Crystal Reports.
Remarks ● Make certain that you enclose your selection formula in single
quotes.
● If your selection formula includes internal quotes, for example:
{file.STATE} = ‘CA’
change all of the internal single quotes to double quotes and then
surround the entire selection formula in single quotes as follows:
‘{file.STATE} = "CA"’
● If you have created a selection formula in your report at design
time, any selection formula you enter here will be appended to
that selection formula. Thus, your records will be selected based
on a combination of the two selection formulas.
Related Topics
Resetting TCrpe Array String Properties 208
SortFields Property
Description Specifies the field(s) that are to be used to sort your data when the
report is printed.
Usage [form.]Report.SortFields(ArrayIndex)
[:="{+|-}SortField"];
Related Topics
Resetting Array Properties 207
SQLQuery Property
Description Sets the SQL query string used by the specified report.
Usage [form.]Report.SQLQuery(SequentialIndex)
[:=SQLQuery];
For example:
Crpe1.SQLQuery[0] := ‘SELECT authors.au_id,
authors.au_lname,’;
Crpe1.SQLQuery[1] := ‘ authors.au_fname FROM
pubs2.dbo.authors’;
Crpe1.SQLQuery[2] := ‘ authors WHERE
authors.au_lname > ‘‘Madison’’’;
«Queries the SQL database to return only the records where the
authors last name falls after Madison alphabetically.»
Remarks ● You may only change the WHERE and FROM sections of an SQL
query. Although the property requires that you enter the entire
SQL query, the SELECT section must not be different from the
original query.
● If you are going to include an ORDER BY clause, you must
precede it with CHR(13) and CHR(10).
Status Property
Usage [form.]Report.Status;
For example:
Status := Crpe1.Status;
«Fetches the print status and saves it to the Status variable.»
Remarks The Status property will return one of the following values:
● 0 - The report has not been printed or has not finished printing.
● 3 - The report has finished printing.
● 5 - The report has been cancelled by the user.
When previewing a report, a status of 3 will only be returned when
the user has previewed to the last page of the report.
StoredProcParam Property
Description Sets the stored procedure parameters when using a report based on
SQL stored procedures.
Availability Runtime
Related Topics
Resetting Array Properties 207
Access Notes Sparse Array Properties 208
UserName Property
Description Enters the name given to a user for logging on to a protected Access
.mdb file to obtain data files needed by the report.
Usage [form.]Report.UserName[:=Name];
For example:
Crpe1.UserName := ‘MIS’;
«Enters the user name "MIS".»
Availability Runtime
Usage [form.]Report.WindowBorderStyle
[:=TFormBorderStyle];
For example:
Crpe1.WindowBorderStyle := bsSizeable;
«Sets a sizeable border style for the print window.»
Remarks Select one of the following border styles for the print window:
● bsNone (creates a window with no border).
● bsSingle (creates a window of a fixed size with a single line
border).
● bsSizeable (creates a window that can be resized by the user).
● bsFialog (creates a window of fixed size with a double line
border).
Select a value here only if you are printing to a window, if
Destination := toWindow (see Destination Property, Page 138).
WindowControlBox Property
Usage [form.]Report.WindowControlBox[:={True|False}];
For example:
Crpe1.WindowControlBox := True;
Remarks ● Select True if you want the window to contain a control box.
Select False if you do not.
● Select a value here only if you are printing to a window, if
Destination := toWindow (see Destination Property, Page 138).
WindowControls Property
Description Specifies whether or not the print controls are to appear in the Print
window when printing a report to a window.
Usage [form.]Report.WindowControls[:={True|False}];
For example:
Crpe1.WindowControls := True;
«Specifies that print controls are to appear in the Print window.»
WindowHeight Property
Description Sets the height of the print window when the report is printed to a
window.
Usage [form.]Report.WindowHeight[:=Height];
Remarks ● If you are not satisfied with the default settings, enter the external
height you want for your print window in pixels.
● Select a value here only if you are printing to a window, if
Destination := toWindow (see Destination Property, Page 138).
WindowLeft Property
Description Sets the distance, in pixels, that the print window is to appear from
the left edge of the parent window. If the print window is a top level
window, then the distance is measured from the left edge of the
screen.
Usage [form.]Report.WindowLeft[:=Distance];
For example:
Crpe1.WindowLeft := 100;
«Sets the left edge of the print window 100 pixels from the left
edge of the screen.»
Remarks ● If you are not satisfied with the default settings, enter the number
of pixels you want between the left edge of the screen and the left
edge of your window.
● Select a value here only if you are printing to a window, if
Destination := toWindow (see Destination Property, Page 138).
Usage [form.]Report.WindowMaxButton[:={True|False}];
For example:
Crpe1.WindowMaxButton := False;
«Specifies that no Maximize button is to appear in the print
window.»
Remarks ● Select True if you want the window to contain a maximize button.
Select False if you do not.
● Select a value here only if you are printing to a window, if
Destination := toWindow (see Destination Property, Page 138).
WindowMinButton Property
Usage [form.]Report.WindowMinButton[:={True|False}];
For example:
Crpe1.WindowMinButton := True;
«Specifies that a Minimize button is to appear in the print
window.»
WindowParentHandle Property
Description Specifies the window handle for the parent window to be used for
this print window (except when the print window is to be a top level
window, in which case this param is 0). The property is for people
who want their report to print to a windowed control (eg. a panel).
Usage [form.]Report.WindowParentHandle[:=handle];
For example:
crpe1.windowparenthandle :=
form1.panel1.handle;
«Prints the report to panel1 inside of form1.»
Availability Runtime
WindowState Property
Usage [form.]Report.WindowState[:=TWindowState];
WindowTitle Property
Description Specifies the title you want to appear in the print window title bar
when the report is printed to a window.
Usage [form.]Report.WindowTitle[:=Title];
For example:
Crpe1.WindowTitle := ‘Quarterly Earnings’;
«Sets the title of the print window (the string that appears on the
title bar) to "Quarterly Earnings".»
WindowTop Property
Description Sets the distance, in pixels, that the print window is to appear from
the top edge of the parent window. If the print window is a top level
window, then the distance is measured from the top edge of the
screen.
Usage [form.]Report.WindowTop[:=Distance];
For example:
Crpe1.WindowTop := 100;
«Sets the top edge of the print window 100 pixels from the top of
the screen.»
Remarks ● If you are not satisfied with the default setting, enter the number
of pixels you want between the top of the screen and the top of
your window.
● Select a value here only if you are printing to a window, if
Destination := toWindow (see Destination Property, Page 138).
WindowWidth Property
Usage [form.]Report.WindowWidth[:=Width];
Remarks ● If you are not satisfied with the default setting, enter the external
width of your window, in pixels.
● Select a value here only if you are printing to a window, if
Destination := toWindow (see Destination Property, Page 138).
ZoomMagnification Method
Description Sets the magnification factor for the report in the print window to a
value from 25% to 400% of the actual size.
Usage [form.]Report.ZoomMagnification :=
[(PercentZoomLevel)]
For example:
Crpe1.ZoomMagnification := 150;
´Sets the magnification/zoom level to 150% for the current
report.ª
Remarks This method is only valid when the report is printed to a Preview
window.
This method must be called after the Action (see Page 135) or Execute
property (see Page 144).
Usage [form.]Report.ZoomPreviewWindow
[:=TPreviewWindowZoom];
For example:
Crpe1.ZoomPreviewWindow := pwFullSize;
Availability Runtime
METHODS
Clear Method
Description This method is used to clear string properties and array properties.
Usage [form.]Report.[StringProperty.]Clear;
For example:
Crpe1.SelectionFormula.Clear;
«This code reinitializes the array of any strings that were
previously set.»
Remarks Resets the VCL if you wish to use the VCL for more than one report.
For example:
Crpe1.Clear;
CloseWindow Method
Usage [form.]Report.CloseWindow;
For example:
Crpe1.CloseWindow;
«Closes the current report that is displayed.»
Remarks Closes the current preview window. This method is used mostly
when not using standard window controls.
Availability Runtime
ExportPrintWindow Method
Description Exports the report displayed in the print window. It will bring up the
Export dialog boxes for the user to fill in the required information.
Usage [form.]Report.ExportPrintWindow([{True|False},
{True|False}]);
For example:
Crpe1.ExportPrintWindow(True,True);
«Exports the report that is currently displayed in the window.»
Availability Runtime
Description This method returns True if the associated print window has the
input focus.
Usage [form.]Report.Focused;
For example:
If Crpe1.Focused then
ShowMessage (‘Preview has focus’);
«Prints the message, "Preview has focus" if the reoprt is in the
forefront with control.»
Availability Runtime
PageCount Method
Usage [form.]Report.PageCount
For example:
NumberofPages := Crpe1.PageCount;
Remarks PageCount must be called after the Action (see Page 135) or Execute
(see Page 144) property to get a valid page count.
PrintWindow Method
Description Prints the report displayed in the print window to the printer.
Usage [form.]Report.PrintWindow([{True|False}]);
Availability Runtime
ReportWindowHandle Method
Usage [form.]Report.ReportWindowHandle;
For example:
Type
MyWin : hWnd;
Begin
Crpe1.Execute;
MyWin := Crpe1.ReportWindowHandle;
While IsWindow(MyWin) Do
Application.ProcessMessages;
End;
«This sample will halt the execution of the application until the
preview window is closed.»
Availability Runtime
SetFocus Method
Description The SetFocus method gives the input focus to the associated print
window.
Usage [form.]Report.SetFocus;
Availability Runtime
ShowFirstPage Method
Description The ShowFirstPage method will display the first page in the
associated print window.
Usage [form.]Report.ShowFirstPage;
For example:
Crpe.ShowFirstPage;
Remarks Due to changes in the 5.0 Report Engine, in versions 1.08.21 and
2.00.13.32 and earlier of the Crystal VCL this Method will only be
enabled after the user has previewed to the last page of the report.
Availability Runtime
ShowLastPage Method
Description The ShowLastPage method will display the last page in the
associated print window.
Usage [form.]Report.ShowLastPage;
For example:
Crpe1.ShowLastPage
Remarks Due to changes in the 5.0 Report Engine, in versions 1.08.21 and
2.00.13.32 and earlier of the Crystal VCL this Method will only be
enabled after the user has previewed to the last page of the report.
ShowNextPage Method
Description The ShowNextPage method will display the next page in the
associated print window.
Usage [form.]Report.ShowNextPage;
For example:
Crpe1.ShowNextPage;
Remarks Due to changes in the 5.0 Report Engine, in versions 1.08.21 and
2.00.13.32 and earlier of the Crystal VCL this Method will only be
enabled after the user has previewed to the last page of the report.
Availability Runtime
ShowPage Method
Remarks This method is only valid when the report is printed to a Preview
window.
This method must be called after the Action (see Page 135) or Execute
(see Page 144) property.
Description The ShowPreviousPage method will display the previous page in the
associated print window.
Usage [form.]Report.ShowPreviousPage;
For example:
Crpe1.ShowPreviousPage;
Remarks Due to changes in the Crystal Report Engine for version 5.0, in
versions 1.08.21 and 2.00.13.32 and earlier of the Crystal VCL this
Method will only be enabled after the user has previewed to the last
page of the report.
Availability Runtime
EVENTS
OnExecute Event
Description Called when the control receives either the Execute or Action
Messages (see Action Property, Page 135).
Usage If you double click on this from the Events page, this procedure will
be created:
procedure TForm1.Crpe1Execute(Sender: TObject;
var Cancel: Boolean);
begin
end;
OnLoadDataFiles Event
Description Called when the current job is open, but not started.
Usage If you double click on this from the Events page, this procedure will
be created:
procedure TForm1.Crpe1LoadDataFiles(Sender:
TObject; const Count: Integer;
var Cancel: Boolean);
begin
end;
Availability Runtime
TUTORIALS
Resetting Array Properties
The Nth array element may be set without having to set up to the
previous N-1 elements. For example, the 7th table location may be set
by issuing Crpe1.DataFiles[6] := sTableName; on it's own.
Construction CRPELogOnInfo
Constructs a CRPELogOnInfo structure type.
Related Topics
PELogOnInfo 678
CRPELogOnInfo:CRPELogOnInfo
CRPELogOnInfo ();
CRPELogOnInfo (const char *serverName, const char *databaseName,
const char *userID, const char *password);
Class CRPELogOnInfo
structure CRPEJobInfo
Construction CRPEJobInfo
Constructs a CRPEJobInfo structure type.
Related Topics
PEJobInfo 676
CRPEJobInfo::CRPEJobInfo
CRPEJobInfo ();
Class CRPEJobInfo
structure CRPETableType
Construction CRPETableType
Constructs a CRPETableType structure type.
Related Topics
PETableType 698
CRPETableType::CRPETableType
CRPETableType ();
Class CRPETableType
structure CRPESessionInfo
This structure is used to get and set the session information (user id
and password) for password protected Microsoft Access databases.
It is used with the CRPEJob::GetNthTableSessionInfo and
CRPEJob::SetNthTableSessionInfomember functions.
Related Topics
PESessionInfo 693
CRPESessionInfo::CRPESessionInfo
CRPESessionInfo ();
CRPESessionInfo (const char *userID, const char *password,
DWORD sessionHandle);
Parameters userID
Specifies the user I.D. needed for logging on to the MS Access
system. Assigns this value to the CRPESessionInfo::m_userID
member.
password
Specifies the password needed for logging on to the MS Access system.
Assigns this value to the CRPESessionInfo::m_password member.
sessionHandle
The handle to the current MS Access session. Assigns this value to
the CRPESessionInfo::m_sessionHandle member.
Class CRPESessionInfo
structure CRPETableLocation
Construction CRPETableLocation
Constructs a CRPETableLocation structure type.
Related Topics
PETableLocation 696
CRPETableLocation::CRPETableLocation
CRPETableLocation ();
CRPETableLocation (const char *location);
Parameters location
Specifies the database location. Assigns this value to the
CRPETableLocation::m_location member.
Class CRPETableLocation
structure CRPEPrintOptions
Construction CRPEPrintOptions
Constructs a CRPEPrintOptions structure type.
Related Topics
PEPrintOptions 688
CRPEPrintOptions::CRPEPrintOptions
CRPEPrintOptions ();
CRPEPrintOptions (unsigned short startPageN, unsigned short
stopPageN, unsigned short nReportCopies, unsigned short
collation);
Parameters startPageN
Specifies the first page that you want to print. Assigns this value to
the CRPEPrintOptions::m_startPageN member.
stopPageN
Specifies the last page that you want to print. Assigns this value to
the CRPEPrintOptions::m_stopPageN member.
nReportCopies
Specifies the number of copies that you want to print. Assigns this
value to the CRPEPrintOptions::m_nReportCopies member.
collation
Indicates whether or not you want the copies of the report to be
collated (if you are printing multiple copies of a multiple page report.
Assigns this value to the CRPEPrintOptions::m_collation member.
Class CRPEPrintOptions
structure CRPEExportOptions
This structure is used to get and set the export options of a print job.
It is used by member functions CRPEJob::GetExportOptions and
CRPEJob::ExportTo.
Construction CRPEExportOptions
Constructs a CRPEExportOptions structure type.
Related Topics
PEExportOptions 662
CRPEExportOptions::CRPEExportOptions
CRPEExportOptions ();
CRPEExportOptions (const char *formatDLLName, DWORD
formatType, void *formatOptions, const char *destinationDLLName,
DWORD destinationType, void *destinationOptions);
Parameters formatDLLName
Specifies the name of the format DLL that contains the export format
to be used. Assigns this value to the
CRPEExportOptions::m_formatDLLName member.
formatType
Specifies the export format to be used. Assigns this value to the
CRPEExportOptions::m_formatType member. Select from the
following values:
To export a report in
this format: Use this structure:
destinationDLLName
Specifies the name of the destination DLL that contains the
destination type to be used. Assigns this value to the
CRPEExportOptions::m_destinationDLLName member.
To export a report to
this destination: Use this DLL name:
destinationType
Specifies the destination type of the exported report. Assigns this
value to the CRPEExportOptions::m_destinationType member. The
following values are available:
To export a report to
this destination: Use this destination type:
destinationOptions
Provides additional information specific to the export destination
type. Assigns this value to the
CRPEExportOptions::m_destinationOptions member. If you assign
NULL to this parameter, the Report Engine will automatically
prompt the user for destination information when needed.
Otherwise, use a destination options structure from the following
table:
To export a report to
Use this structure:
this destination:
Disk File UXDDiskOptions
E-mail (MAPI) UXDMAPIOptions
E-mail (VIM) UXDVIMOptions
Class CRPEExportOptions
Construction CRPESectionOptions
Constructs a CRPESectionOptions structure type.
Related Topics
PESectionOptions 690
CRPESectionOptions::CRPESectionOptions
CRPESectionOptions ();
CRPESectionOptions (short visible, short newPageBefore, short
newPageAfter, short keepTogether, short suppressBlankLines, short
resetPageNAfter, short printAtBottomOfPage, COLORREF
backgroundColour, short underlaySection);
Parameters visible
Specifies whether or not the selected section is to be visible. Use
TRUE to keep the section visible, FALSE to hide the section. Assigns
this value to the CRPESectionOptions::m_visible member.
newPageBefore
Specifies whether or not the Report Engine is to insert a page break
before the section is printed. Use TRUE to insert a page break, FALSE
to leave it without a page break. Assigns this value to the
CRPESectionOptions::m_newPageBefore member.
newPageAfter
Specifies whether or not the Report Engine is to insert a page break after
the section is printed. Use TRUE to insert a page break, FALSE to leave it
without a page break. Assigns this value to the
CRPESectionOptions::m_newPageAfter member.
keepTogether
Specifies whether or not the Report Engine is to keep all lines of the section
together, either on the current page (if there is room), or on the next page.
Class CRPESectionOptions
Construction CRPEGraphDataInfo
Constructs a CRPEGraphDataInfo structure type
Related Topics
PEGraphDataInfo 668
CRPEGraphDataInfo::CRPEGraphDataInfo
CRPEGraphDataInfo ();
CRPEGraphDataInfo (short rowGroupN, short colGroupN, short
summarizedFieldN, short graphDirection);
Class CRPEGraphDataInfo
Construction CRPEGraphTextInfo
Constructs a CRPEGraphTextInfo structure type.
Related Topics
PEGraphTextInfo 673
CRPEGraphTextInfo ();
CRPEGraphTextInfo (const char *graphSubTitle, const char
*graphFootNote, const char *graphGroupsTitle, const char
*graphSeriesTitle, const char *graphXAxisTitle, const char
*graphYAxisTitle, const char *graphZAxisTitle);
Parameters graphTitle
Specifies the main title text that will appear above your graph.
Assigns this title to the CRPEGraphTextInfo::m_graphTitle
member variable.
graphSubTitle
Specifies the sub title text that will appear directly under the main
title. Assigns this title to the
CRPEGraphTextInfo::m_graphSubTitle member variable.
graphFootNote
Specifies the footnote text that will appear under your graph.
Assigns this text to the CRPEGraphTextInfo::m_graphFootNote
member variable.
graphGroupsTitle
Specifies the title of the groups which are being graphed. Assigns
this title to the CRPEGraphTextInfo::m_graphGroupsTitle member
variable.
graphSeriesTitle
Specifies the title of the series which is being graphed. Assigns this
title to the CRPEGraphTextInfo::m_graphSeriesTitle member
variable.
graphXAxisTitle
Specifies the title text that will appear for the X axis. Not valid for Pie
graphs. Assigns this title to the
CRPEGraphTextInfo::m_graphXAxisTitle member variable.
graphYAxisTitle
Specifies the title text that will appear for the Y axis. Not valid for Pie
graphs. Assigns this title to the
CRPEGraphTextInfo::m_graphYAxisTitle member variable.
Class CRPEGraphTextInfo
structure CRPEGraphOptions
Construction CRPEGraphOptions
Constructs a CRPEGraphOptions structure type.
Related Properties
PEGraphOptions 671
CRPEGraphOptions::CRPEGraphOptions
CRPEGraphOptions ();
CRPEGraphOptions (double graphMaxValue, double graphMinValue,
BOOL showDataValue, BOOL showGridLine, BOOL verticalBars,
BOOL showLegend, const char *fontFaceName);
Parameters graphMaxValue
Specifies the maximum value that will appear in the graph. Any
graph values above this value are not charted. Assigns this value to
the CRPEGraphOptions::m_graphMaxValue member variable.
graphMinValue
Specifies the minimum value that will appear in the graph. Any
graph values below this value are not charted. Assigns this value to
the CRPEGraphOptions::m_graphMinValue member variable.
showDataValue
Specifies whether or not to display the numerical value associated
with each riser on the chart. If set to TRUE, a value appears in the
graph for each riser. Assigns this value to the
CRPEGraphOptions::m_showDataValue member variable.
showGridLine
Specifies whether or not to display grid lines on the graph. Assigns
this value to the CRPEGraphOptions::m_showGridLine member
variable.
verticalBars
Specifies whether to display the bars in a bar graph vertically or
horizontally. Assigns this value to the
CRPEGraphOptions::m_verticalBars member variable.
Class CRPEGraphOptions
structure CRPEParameterFieldInfo
Construction CRPEParameterFieldInfo
Constructs a CRPEParameterFieldInfo structure type.
CRPEParameterFieldInfo::CRPEParameterFieldInfo
CRPEParameterFieldInfo ();
CRPEParameterFieldInfo (WORD ValueType, WORD
DefaultValueSet, WORD CurrentValueSet, const _TCHAR *Name,
const _TCHAR *Prompt, const _TCHAR *DefaultValue, const
_TCHAR *CurrentValue);
Parameters ValueType
Specifies the data type of the parameter field. The Report Engine
supports the following data types: number, currency, Boolean, date,
and string. Assigns this value to the
CRPEParameterFieldInfo::m_ValueType member variable.
Use the appropriate constant from the list below.
DefaultValueSet
Specifies whether or not a default value is set for the parameter field.
The value can be either TRUE (1) if you want to change the default
value or FALSE (0) if you do not. Assigns this value to the
CRPEParameterFieldInfo::m_DefaultValueSet member variable.
CurrentValueSet
Indicates whether or not a new value is being assigned to the
parameter field. Use TRUE (1) to indicate that a new value is set,
FALSE (0) to indicate no change. Assigns this value to the
CRPEParameterFieldInfo::m_CurrentValueSet member variable.
Class CRPEParameterFieldInfo
structure CRPEParameterInfo
m_Name
Specifies the name of the parameter in a null-terminated string.
Construction CRPEParameterInfo
Constructs a CRPEParameterInfo structure type.
Related Topics
PEParameterInfo 685
CRPEParameterInfo::CRPEParameterInfo
CRPEParameterInfo();
Class CRPEParameterInfo
structure CRPESubreportInfo
Related Topics
PESubreportInfo 695
CRPESubreportInfo::CRPESubreportInfo
CRPESubreportInfo();
Class CRPESubreportInfo
Construction CRPEngine
Constructs a CRPEngine object.
Construction CRPEJob
Constructs a CRPEJob object. Used internally by
CRPEngine::OpenJob.
CRPEngine::CRPEngine
CRPEngine(BOOL open);
Parameters open
Indicates whether or not the Report Engine should be opened when
the CRPEngine object is created.
Remarks This is the constructor for the class. If open is true, the actual Crystal
Reports DLL is opened (crpe32.dll). Print jobs may only be opened if
the engine itself is open. If originally opened with open = FALSE, the
engine may be opened later with the CRPEngine::Open method.
Class CRPEngine
BOOL Open();
Remarks This method opens the Crystal Report Engine. This method is only
necessary if you constructed the CRPEngine object with the open
parameter equal to FALSE. If you set the open parameter to TRUE when
you constructed the CRPEngine object, this method is unnecessary.
Return Value Returns TRUE if the Report Engine was opened successfully, FALSE
if something went wrong.
Class CRPEngine
Related Topics
CRPEngine::CRPEngine 237
PEOpenEngine 536
CRPEngine::Close
void Close();
Class CRPEngine
Related Topics
PECloseEngine 438
Parameters versionRequested
Specifies whether the version number of the Report Engine or the
Report Engine DLL is being requested. Possible values are:
Remarks This method returns the version number of the Report Engine dll
(crpe32.dll) or the version of the Report Engine itself. The high-order
byte is the major version number and the low-order byte is the minor
version number.
This method can be used whenever you build functionality into a
report that may not be available in earlier versions of the Report
Engine and you need to verify the version number first. The function
can be a handy safeguard for users who have more than one version
of the Report Engine with the older version earlier in the path than
the new version.
Return Value The version number of the currently used Report Engine or Report
Engine DLL.
Class CRPEngine
Related Properties
PEGetVersion 524
CRPEngine::GetEngine
Remarks This method may be used to get a pointer to the current CRPEngine
object being used in the application.
Class CRPEngine
CRPEngine::GetEngineStatus
Remarks This method may be used to get the current engine status. Possible
values returned are:
engineOpen
The Report Engine is currently open.
engineClosed
The Report Engine has been closed, or is not yet open.
engineMissing
No Report Engine is available. Make sure the Report Engine DLL is
located in a directory that appears in your PATH.
Return Value A value of the Status enumerated type. Indicates the current status of
the Report Engine.
Class CRPEngine
CRPEngine::OpenJob
Parameters reportFileNameThe name and path (if necessary) of the report file
being opened for the specified print job.
Return Value A pointer to a CRPEJob object for the opened print job.
Related Properties
PEOpenPrintJob 537
CRPEngine::PrintReport
Parameters reportFilePath
Specifies the name and path of the report to be printed.
toPrinter
Specifies whether or not the report is to be sent to the default printer.
toWindow
Specifies whether or not the report is to be displayed in a Preview
Window.
title
Specifies the title you want to appear in the title bar if the report is
being sent to a Preview Window.
left
Specifies the x coordinate of the upper left hand corner of the
Preview Window, in device coordinates.
top
Specifies the y coordinate of the upper left hand corner of the
Preview Window, in device coordinates.
width
Specifies the width of the Preview Window, in device coordinates.
height
Specifies the height of the Preview Window, in device coordinates.
style
Specifies the style of the window being created. Style setting can be
combined using the bitwise "OR" operator. Refer to the CWnd class
in the Microsoft Foundation Class Library reference for possible
window styles.
Remarks This method provides a quick but limited way to print a report. The
report may only be output to a printer or Preview Window. Use this
class method any time you simply want to print a report from an
application without giving the user the ability to customize the
report.
Return Value 0 if the call is successful. Returns an error code if something goes
wrong.
Class CRPEngine
Related Topics
PEPrintReport 549
CRPEngine::LogOnServer
Parameters dllName
Specifies the name of the Crystal Reports DLL for the server or
password protected non-SQL table you want to log onto.
logOnInfo
Specifies a pointer to a CRPELogOnInfo structure.
Remarks This method opens a connection to a SQL server. More than one print
job may use this connection to a SQL server. Information required to
establish a connection is provided through the CRPELogOnInfo.
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Related Topics
PELogOnServer 531
CRPEngine::LogOffServer
Parameters dllName
Specifies the name of the Crystal Reports DLL for the server or
password protected non-SQL table you want to log onto.
logOnInfo
Specifies a pointer to a CRPELogOnInfo structure.
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEngine
Related Topics
PELogOffServer 529
CRPEngine::LogOnSQLServerWithPrivateInfo
Parameters dllName
Specifies the name of the Crystal Reports DLL that was used when
establishing a connection to the Server when the report was first
created. For example, if a report was created using an ODBC data
Remarks Use this class method to allow the Crystal Report Engine to
"piggyback" your application’s existing connection to a Server. This
lowers the number of connections established by a workstation,
reducing application time and network traffic. It also prevents a
Crystal Reports Log Off call from disconnecting an application’s
existing connection to the Server.
The CRPEngine::LogOnSQLServerWithPrivateInfo method can
only be used with database connections established by ODBC or
Q+E Library 2.0. Any other database connections can not be accessed
by this method.
To obtain an HDBC for an ODBC connection, use the following
function calls (see the ODBC SDK 2,0 manual for more information):
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEngine
Remarks Checks to see whether or not the Report Engine is busy. Errors can
occur in your application or on a system if you attempt to close the
Report Engine while it is processing a print job. Use this method
before attempting to close the Report Engine in an application (for
example, when the user tries to exit) to determine if the Report
Engine can be closed safely.
Return Value TRUE if the Report Engine can be closed, FALSE if the Report Engine
is still busy.
Class CRPEngine
CRPEngine::GetNPrintJobs
Remarks This method returns the number of print job (CRPEJob) objects that
currently exist for the current CRPEngine object.
Return Value The number of CRPEJob objects currently open. Returns -1 if an error
occurs.
Class CRPEngine
CRPEngine::GetErrorCode
short GetErrorCode();
Remarks This method returns the current error code of the Report Engine.
When a call to another function fails, this call gets the error code that
was generated so you can take some action based on that error code.
Class CRPEngine
Related Topics
PEGetErrorCode 452
CRPEngine::GetErrorText
CString GetErrorText();
Return Value A CString object containing the text for the current error.
Class CRPEngine
Related Topics
PEGetErrorText 453
CRPEJob::CRPEJob
CRPEJob(short jobHandle);
Parameters jobHandle
Handle to the job created by CRPEngine::OpenJob().
Remarks This is the constructor for the class. It also stores the job number
internally for future use in Report Engine API calls.
NOTE: This class constructor is automatically called by
CRPEngine::OpenJob(). Do not call this constructor from within
your own code.
Class CRPEJob
BOOL Start();
Remarks This method is used to start the processing of the print job and
display the final output of that processing. This is the method that
actually prints or exports the report.
Return Value TRUE if the job is started successfully, FALSE if something goes
wrong.
Class CRPEJob
Related Topics
PEStartPrintJob 613
CRPEJob::Close
void Close();
Remarks This method closes the print job. It also calls the destructor for the
CRPEJob object. If printing has not yet finished when this method is
called, it continues until the job is completely printed. If the Preview
Window is open, it stays open.
Class CRPEJob
Related Topics
PEClosePrintJob 439
CRPEJob::Cancel
void Cancel();
Related Topics
PECancelPrintJob 431
CRPEJob::GetJobStatus
Parameters jobStatus
A pointer to a CRPEJobInfo structure.
Remarks This method gets the current status of the print job. You can use it in
a number of programming situations, for example:
● to trigger error messages, i.e., when a print job fails (due to
insufficient memory, insufficient disk space, etc.) or,
● to trigger screen displays (hourglass, series of graphics, etc.) that
confirm to the user that work is in progress.
● to find out whether a job was cancelled by the user after
CRPEJob::Start was called.
Return Value Returns one of the following values according to the status of the
current print job:
Class CRPEJob
CRPEJob::IsJobFinished
BOOL IsJobFinished();
Remarks This method returns a Boolean value that indicates whether or not
processing has finished for the print job. You can use this method any
time you have a call that is contingent on a print job being finished.
Return Value TRUE if processing has finished, FALSE if the job is in progress.
Class CRPEJob
Related Topics
PEIsPrintJobFinished 528
CRPEJob::GetJobHandle
short GetJobHandle();
Remarks This method returns the job handle for the print job.
Return Value The print job handle for the CRPEJob object.
Class CRPEJob
CRPEJob::ShowNextPage
BOOL ShowNextPage();
Remarks This method shows the next page in the Preview Window. Use this
method to customize how a user moves through pages in a report.
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
CRPEJob::ShowFirstPage
BOOL ShowFirstPage();
Remarks This method shows the first page in the Preview Window. Use this
method to customize how a user moves through pages in a report.
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
Related Topics
PEShowFirstPage 608
CRPEJob::ShowPreviousPage
BOOL ShowPreviousPage();
Remarks This method shows the previous page in the Preview Window. Use
this method to customize how a user moves through pages in a
report.
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
Related Topics
PEShowPreviousPage 608
CRPEJob::ShowLastPage
BOOL ShowLastPage();
Remarks This method shows the last page in the Preview Window. Use this
method to customize how a user moves through pages in a report.
Class CRPEJob
Related Topics
PEShowLastPage 608
CRPEJob::ShowPrintControls
Parameters showControls
TRUE indicates default Print controls are to be displayed in the
Preview Window. FALSE indicates no controls are to be displayed.
Remarks This method toggles the display of the Preview Window control
buttons. Use this to display default controls, or to hide default
controls and provide customized controls.
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
Related Topics
PEShowPrintControls 612
CRPEJob::ZoomPreviewWindow
Parameters level
The magnification level to which the Preview Window is to be
"zoomed". Use one of the following values:
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
Related Topics
PEZoomPreviewWindow 617
CRPEJob::NextWindowMagnification
BOOL NextWindowMagnification();
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
Related Topics
PENextPrintWindowMagnification 535
CRPEJob::PrintWindow
BOOL PrintWindow();
Remarks This method prints the report displayed in the Preview Window to
the printer. If you are customizing Preview Window controls, use
this method to enable the user to preview the report in the Preview
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
Related Topics
PEPrintWindow 552
CRPEJob::ExportPrintWindow
Parameters toMail
Specifies whether or not the report file should be exported to an E-
mail address. If TRUE, the file is exported to E-mail. If FALSE, the file
is exported to a disk file.
Remarks This method exports the report displayed in the Preview Window to
a disk file or E-mail address. If you are customizing Preview
Window controls, use this method to enable the user to preview the
report in the Preview Window, and if everything looks satisfactory,
to export the report to a disk file or E-mail address (in response to a
user event - button click, menu command, etc.).
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
void CloseWindow();
Remarks This method closes the Preview Window. If you are customizing
Preview Window controls, implement this method to allow the user
to close the Preview Window when finished viewing the report.
Class CRPEJob
Related Topics
PECloseWindow 441
CRPEJob::GetWindowHandle
HWND GetWindowHandle();
Remarks This method returns the Windows handle for the Preview Window.
When this method returns successfully, you can use the HWND
value with any Windows API function that requires a window
handle as a parameter.
Class CRPEJob
Related Topics
PEGetWindowHandle 525
CRPEJob::TestNthTableConnectivity
Parameters tableN
Specifies the number of the table for which you want to test the
connection settings. The first table added to a report is numbered 0,
the second is 1, etc.
Return Value TRUE if the database session, log on, and location info. is all correct.
FALSE if something is wrong.
Class CRPEJob
Related Topics
PETestNthTableConnectivity 615
CRPEJob::GetNTables
short GetNTables();
Return Value The number of tables used in the report. Returns -1 if an error occurs.
Class CRPEJob
Related Topics
PEGetNTables 488
CRPEJob::GetNthTableType
Parameters tableN
0 indexed table number indicating which table in the report for
which you want to determine the type.
tableType
A pointer to a CRPETableType structure.
Return Value TRUE if the call is successful, FALSE if anything goes wrong.
Class CRPEJob
Related Topics
PEGetNthTableType 507
CRPEJob::GetNthTableSessionInfo
Parameters tableN
A 0 indexed table number indicating which MS Access table in the
report you wish to obtain the session information for.
sessionnInfo
A pointer to a CRPESessionInfo structure.
Remarks This methods gets session information for the specified Microsoft
Access table. Many MS Access database tables require that a session
be opened before the information in the table can be used. Use this
method to obtain the session information (User ID and Session
Handle) for a particular tab.
Return Value TRUE if the call is successful, FALSE if anything goes wrong.
Class CRPEJob
Related Topics
PEGetNthTableSessionInfo 505
Parameters tableN
0 indexed table number indicating which MS Access table in the
report the session is being opened for.
sessionInfo
A pointer to a CRPESessionInfo structure.
propagate
TRUE or FALSE value indicating whether the session information
should be used for opening all tables being used in the report.
Remarks This methods sets session information for the specified Microsoft
Access table. Many MS Access database tables require that a session
be opened before the table can be used. Use this method to open the
session.
Return Value TRUE if the call is successful, FALSE if anything goes wrong.
Class CRPEJob
Related Topics
PESetNthTableSessionInfo 505
CRPEJob::GetNthTableLocation
Parameters tableN
Specifies the 0 indexed number of the table for which you want to
retrieve location information.
tableLocation
A pointer to a CRPETableLocationstructure.
Return Value TRUE if the call is successful, FALSE if anything goes wrong.
Class CRPEJob
Related Topics
PEGetNthTableLocation 502
CRPEJob::SetNthTableLocation
Parameters tableN
Specifies the 0 indexed number of the table for which you want to set
a new location.
tableLocation
A pointer to a CRPETableLocation structure.
Remarks This method sets table location information for the specified table in
the report. This method is typically combined with the
CRPEJob::GetNthTableLocation method to identify the location of a
table and then to change it.
Return Value TRUE if the call is successful, FALSE if anything goes wrong.
Class CRPEJob
Related Topics
PESetNthTableLocation 589
Parameters tableN
Specifies the 0 indexed number of the table from which you want to
get log on information.
logonInfo
A pointer to a CRPELogOnInfo structure.
Remarks This method gets SQL connection information for the specified table.
Return Value TRUE if the call is successful, FALSE if anything goes wrong.
Class CRPEJob
Related Topics
PEGetNthTableLogOnInfo 504
CRPEJob::SetNthTableLogOnInfo
Parameters tableN
Specifies the 0 indexed number of the table for which you want to set
log on information.
logonInfo
A pointer to a CRPELogOnInfo structure.
propagate
TRUE or FALSE value indicating whether the log on information
should be used for opening all tables being used in the report.
Return Value TRUE if the call is successful, FALSE if anything goes wrong.
Class CRPEJob
Related Topics
PESetNthTableLogOnInfo 591
CRPEJob::GetFormula
Parameters formulaName
The name of the formula for which you want to retrieve the formula
string.
formulaText
The CString object passed here is loaded with the specified formula
text when CRPEJob::GetFormula completes successfully.
Remarks This method returns the formula text for the specified formula.
CRPEJob::GetFormula is often used with CRPEJob::SetFormula to
identify and then change an existing formula at print time in
response to a user selection.
Return Value TRUE if the call is successful, FALSE if the named formula does not
exist in the report.
Class CRPEJob
Related Topics
PEGetFormula 456
Parameters formulaName
The name of the formula for which you want to assign new formula
text.
formulaText
The actual formula text that replaces the existing formula string.
Remarks This method sets the formula text for the specified formula.
CRPEJob::SetFormula is often used with CRPEJob::GetFormula to
identify and then change an existing formula at print time in
response to a user selection.
Return Value TRUE if the call is successful, FALSE if the named formula does not
exist in the report, or there is an error in the formula.
Class CRPEJob
Related Topics
PESetFormula 563
CRPEJob::GetSelectionFormula
Parameters formulaText
Specifies the existing selection formula for the report.
Remarks This method returns the formula text for the record selection
formula. CRPEJob::GetSelectionFormula is often used with
CRPEJob::SetSelectionFormula to identify and then change an
existing selection formula at print time in response to a user
selection.
Class CRPEJob
Related Topics
PEGetSelectionFormula 519
CRPEJob::SetSelectionFormula
Parameters formulaText
Specifies the new selection formula to be assigned to the report.
Remarks This method sets the formula text for the record selection formula.
CRPEJob::SetSelectionFormula is often used with
CRPEJob::GetSelectionFormula to identify and then change an
existing selection formula at print time in response to a user
selection.
Return Value TRUE if the call is successful, FALSE if something goes wrong, or
there is an error in the formula.
Class CRPEJob
Related Topics
PESetSelectionFormula 604
CRPEJob::GetGroupSelectionFormula
Parameters formulaText
Specifies the existing group selection formula for the report.
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
Related Topics
PEGetGroupSelectionFormula 468
CRPEJob::SetGroupSelectionFormula
Parameters formulaText
Specifies the new group selection formula to be assigned to the
report.
Remarks This method sets the formula text for the group selection formula.
CRPEJob::SetGroupSelectionFormula is often used with
CRPEJob::GetGroupSelectionFormula to identify and then change
an existing group selection formula at print time in response to a user
selection.
Return Value TRUE if the call is successful, FALSE if something goes wrong, or
there is an error in the formula.
Class CRPEJob
Related Topics
PESetGroupSelectionFormula 575
Parameters sectionCode
Specifies the code for the group section for which you want to set the
group condition. Select a section from the table below:
conditionField
Specifies the field that triggers a summary whenever its value
changes. Use the name of the field as indicated in the report file.
condition
Specifies the condition that needs to be met for Date and Boolean
fields. For all field types except Date and Boolean, use
PEP_GC_ANYCHANGE as the condition parameter.
For Date fields, select from the following:
sortDirection
Specifies one of the following sort directions:
Remarks This method sets the condition of the grouping for the specified
group section. This method can only replace the group condition for
an existing group. It can not create a new group. Use this function
whenever you want to change the grouping at print time, for
example, to print one report grouped in several different ways.
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Related Topics
PESetGroupCondition 566
CRPEJob::GetNSortFields
short GetNSortFields();
Remarks This method gets the number of sort fields in the report.
Return Value The number of sort fields defined in the report. Returns 0 (zero) if
there are no sort fields in the report. Returns -1 if an error occurs.
Class CRPEJob
Related Topics
PEGetNSortFields 485
CRPEJob::GetNthSortField
Parameters sortFieldN
Specifies the number of the sort field you want to retrieve. The first
sort field added to the report is field 0, the second is 1, etc.
field
Assigned the name of the sort field if the call completes successfully.
direction
Assigned the sort direction of the sort field if the call completes
successfully. The following values are possible:
Remarks This method gets the name of the sort field at the specified sort field
position and the direction in which data is sorted (ascending or
descending).
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
Related Topics
PEGetNthSortField 499
CRPEJob::SetNthSortField
Parameters sortFieldN
Specifies the number of the sort field you want to set. The first sort
field added to the report is field 0, the second is 1, etc. If the report
has N sort fields, the function can be called with this parameter
between 0 and N-1 to replace an existing sort field. Call the function
with this parameter equal to N to add a new sort field.
field
Specifies the name of the field to be sorted.
direction
Specifies the sort direction. The following values are possible:
Remarks This method sorts report data according to the specified field and
direction.
Class CRPEJob
Related Topics
PESetNthSortField 587
CRPEJob::DeleteNthSortField
Parameters sortFieldN
Specifies the number of the sort field you want to delete. The first sort
field added to the report is field 0, the second is 1, etc.
Remarks This method deletes the specified sort field from the report. The field
is not deleted from the report, but it is removed from the list of sort
fields, and data in that field no longer appears sorted.
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
Related Topics
PEDeleteNthSortField 444
CRPEJob::GetNGroupSortFields
Remarks Returns the number of group sort fields in the specified report. This
method is typically used as one of a series: GetNGroupSortFields
(called once), GetNthGroupSortField (called as many times as
needed to identify the correct group sort field), and
SetNthGroupSortField (called once, when the correct group sort field
is identified). The series can be used to identify and then change an
Return Value The number of group sort fields in the report. Returns 0 if there are
no group sort fields. Returns -1 if an error occurs.
Class CRPEJob
Related Topics
PEGetNGroupSortFields 479
CRPEJob::SetNthGroupSortField
Parameters sortFieldN
Specifies the number of the group sort field you want to set. The first
group sort field added to the report is field 0, the second is 1, etc. If
the report has N group sort fields, the function can be called with this
parameter between 0 and N-1 to replace an existing group sort field.
Call the function with this parameter equal to N to add a new group
sort field.
field
Specifies the name of the group field to be sorted.
direction
Specifies the sort direction. The following values are possible:
Remarks This method sorts the specified group summary field in the specified
direction (ascending or descending). This method does not create a
new group, but will sort and existing group summary field.
Class CRPEJob
Related Topics
PESetNthGroupSortField 582
CRPEJob::DeleteNthGroupSortField
Parameters sortFieldN
Specifies the number of the group sort field you want to delete. The
first group sort field added to the report is field 0, the second is 1, etc.
Remarks This method deletes the group sort field at the specified position. The
group and group summary are not removed from the report, but the
field is removed from the list of group sort fields, and the summary
data appearing in the group field is no longer sorted.
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
Related Topics
PEDeleteNthGroupSortField 443
CRPEJob::GetSQLQuery
Parameters query
Assigned the text of the SQL query being sent to the server if the call
completes successfully.
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
Related Topics
PEGetSQLQuery 520
CRPEJob::SetSQLQuery
Parameters query
The text of the new SQL query to be sent to the server.
Remarks This method sets the SQL query that will be sent to the database
server. This method can be used with CRPEJob::GetSQLQuery to
retrieve and then change the SQL query for the report.
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
Related Topics
PESetSQLQuery 606
CRPEJob::GetReportTitle
Parameters title
Assigned the title of the report.
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
Related Topics
PEGetReportTitle 512
CRPEJob::SetReportTitle
Parameters title
Specifies a new title for the report.
Remarks This method sets the report title for the print job. Use this method
whenever you need to change the title of a report at print time.
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
Related Topics
PESetReportTitle 598
CRPEJob::SetPrintDate
Parameters year
Specifies the year of the new print date.
month
Specifies the month of the new print date.
Remarks This method sets the print date for the report. This method does not
schedule the report to print at a different time or day, but only
changes the date that appears in any Print Date Field that appears on
the report. Use this method, for example, to post date a report when
it is printed before the day it is distributed.
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
Related Topics
PESetPrintDate 595
CRPEJob::SetPrintOptions
Parameters options
A pointer to a CRPEPrintOptions structure.
Remarks This method may be used to set the print characteristics of a print job.
Use this method any time you want to set the starting page number,
the ending page number, the number of report copies, and/or
collation instructions for a print job at runtime in response to user
specifications.
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
Related Topics
PESetPrintOptions 597
Parameters nCopies
Specifies the number of copies of the detail section of the report to be
printed.
Remarks This method sets the number of times the Details section of the report
is to be printed. For example, you can use this method to print
multiple copies of labels for a customer, multiple copies of a
purchase order, or multiple copies of anything set up in the Details
section of the report.
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
Related Topics
PESetNDetailCopies 580
CRPEJob::SetMargins
BOOL SetMargins (short left, short right, short top, short bottom);
Parameters left
Specifies the left margin in twips.
right
Specifies the right margin in twips.
top
Specifies the top margin in twips.
bottom
Specifies the bottom margin in twips.
Remarks This method sets the page margins for the print job. Use this method
any time you want to allow the user to change margins.
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
Related Topics
PESetMargins 576
CRPEJob::SetMinimumSectionHeight
Parameters sectionCode
Specifies the section for which you want to specify the minimum
height.
Use one of the following values:
Remarks This method sets the minimum height for the specified section. For
example, use this command whenever you want to specify a
minimum section height for printing onto preprinted forms or
printing on to any other kind of document with a fixed format.
Return Value TRUE if the call is successful, FALSE if you have specified an invalid
section or something goes wrong.
Class CRPEJob
Related Topics
PESetMinimumSectionHeight 579
CRPEJob::SetFont
Parameters sectionCode
Specifies the section of the report for which you want to set the font.
Use one of the following values:
faceName
Specifies the actual face name of the font you want to use. The face
name you pass can typically come from a font dialog box, be hard
coded in the application, or be chosen by the application from the
fonts supported on the printer. Example: "Times New Roman".
fontFamily
Specifies the font family for the font you want to use. Use one of the
following values:
fontPitch
Specifies the font pitch you wish to use. Use one of the following
values:
charSet
Specifies the character set you wish to use. Use one of the following
values:
ANSI_CHARSET DEFAULT_CHARSET
SYMBOL_CHARSET SHIFTJIS_CHARSET
HANGEFUL_CHARSET CHINESEBIG5_CHARSET
OEM_CHARSET
pointSize
Specifies the desired point size for the selected font. Use 0 to indicate
no change.
isItalic
Specifies whether the font selected should be italicized. Use 1 for
italics, 0 for no italics, or PEP_UNCHANGED to leave the italics as
set up in the report.
isUnderlined
Specifies whether the font should be underlined. Use 1 to underline,
0 for no underline, or PEP_UNCHANGED to leave underline
settings as specified in the report.
isStruckOut
Specifies whether or not the font should appear struck-out. Use 1 for
strike-out, 0 for no strike out, or PEP_UNCHANGE to leave strike-
out settings as specified in the report.
weight
Specifies the weight of the font. Possible values are:
FW_DONTCARE FW_THIN
FW_EXTRALIGHT FW_LIGHT
FW_NORMAL FW_MEDIUM
FW_SEMIBOLD FW_BOLD
FW_EXTRABOLD FW_HEAVY
Remarks This method sets the font and font characteristics for the specified
section. Use any time you need to change a default font at runtime in
response to user input, or to specify a built-in printer font.
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
Related Topics
PESetFont 557
CRPEJob::OutputToWindow
BOOL OutputToWindow (const _TCHAR *title, int left, int top, int
width, int height, int style, CWnd *parentWindow);
BOOL OutputToWindow (const char *title, int left, int top, int width,
int height, int style, CMDIFrameWnd *parentWindow);
Parameters title
Specifies the title you want to appear in the title bar.
left
Specifies the x coordinate of the upper left hand corner of the
Preview Window, in device coordinates.
top
Specifies the y coordinate of the upper left hand corner of the
Preview Window, in device coordinates.
width
Specifies the width of the Preview Window, in device coordinates.
height
Specifies the height of the Preview Window, in device coordinates.
Remarks This method sets the output of the print job to the Preview Window
which will have the specified attributes. This method does not print
the report, but specifies that when the report is printed, it will appear
in a Preview Window. To actually print the report, use
CRPEJob::Start.
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
Related Topics
PEOutputToWindow 543
CRPEJob::OutputToPrinter
Parameters nCopies
Specifies how many copies of the report are to be printed. Default is
1 copy.
Remarks This method sets the output of the print job to the printer with the
specified number of copies. This method does not print the report,
but specifies that when the report is printed, it will be sent to a
printer. To actually print the report, use CRPEJob::Start.
Class CRPEJob
Related Topics
PEOutputToPrinter 541
CRPEJob::SelectPrinter
Parameters driverName
Specifies the name of the printer driver for the printer being selected.
printerName
Specifies the name of the printer being selected (as indicated in the
Printers Control Panel).
portName
Specifies the name of the port the printer is attached to. For example:
"LPT1:".
mode
A pointer to a DEVMODE structure. The default implementation of
CRPEJob::SelectPrinter ignores this parameter. For more
information on the DEVMODE structure, refer to the Microsoft
Windows SDK.
Remarks This method specifies the printer and/or print characteristics for the
print job. You can use this method to enable the user to select a
printer other than the default printer at print time. One way of doing
this is to have your application call the Windows common Print
Setup dialog box.
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
CRPEJob::ExportTo
Parameters options
A pointer to a CRPEExportOptions structure.
Remarks This method sets the output of the print job to be exported. The
export format is specified through the options parameter. This
method does not export the report, but specifies that when the report
is printed, it will be exported to a disk file or E-mail address
according to settings in the options parameter. To actually export the
report, use CRPEJob::Start.
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
Related Topics
PEExportTo 451
CRPEJob::GetExportOptions
Parameters options
A pointer to a CRPEExportOptions structure.
Remarks This method prompts the user with a series of dialogs to specify the
export options to be used. These options are used by the Class
Library to fill in a CRPEExportOptions structure. The
CRPEJob::ExportTo function can then be used to set the print job
destination using the information in this structure.
Class CRPEJob
Related Topics
PEGetExportOptions 455
CRPEJob::GetErrorCode
Remarks This method gets the error code for the print job. When a call to
another function fails, this call gets the error code that was generated
so you can take some action based on that error code.
Class CRPEJob
Related Topics
PEGetErrorCode 452
CRPEJob::GetErrorText
Remarks This method returns a descriptive error message for the print job.
Return Value A text description of the current Crystal Reports Class Library error
if an error has occurred.
Class CRPEJob
CRPEJob::PrintControlsShowing
Parameters controlsShowing
Returns a pointer to a TRUE value if the print controls will be shown
in the Preview Window, FALSE if they will be hidden.
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
Related Topics
PEPrintControlsShowing 548
CRPEJob::GetNFormulas
Remarks Use this function to fetch the number of formulas in the report. To
fetch the formula by number, use CRPEJob::GetNthFormula.
Return Value The number of formulas in the report. If no formulas exist in the
report, 0 is returned. If an error occurs, -1 is returned.
Class CRPEJob
CRPEJob::GetNthFormula
Parameters formulaN
Specifies the number of the formula about which you want to gather
information. The first formula added to your report is 0, the second
is 1, etc.
formulaName
Retrieves the name of the formula specified.
formulaText
Retrieves the text of the formula specified.
Remarks Use this function to obtain the formula name and formula text of a
specific formula in the report. Once the formula name is obtained,
formula text can be changed with CRPEJob::SetFormula.
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
Related Topics
PEGetNthFormula 489
CRPEJob::CheckFormula
Parameters formulaName
The name of the formula that you need to check for errors.
Return Value TRUE if the formula text is okay, FALSE if there is an error in the
formula or something goes wrong.
Class CRPEJob
Related Topics
PECheckFormula 434
CRPEJob::CheckSelectionFormula
Remarks Use this method to check the record selection formula for the report
for errors. This method works just like the Check button in the
Formula Editor. If the selection formula contains an error, the
method returns FALSE.
Return Value TRUE if the formula text is okay, FALSE if there is an error in the
formula or something goes wrong.
Class CRPEJob
Related Topics
PECheckSelectionFormula 436
CRPEJob::CheckGroupSelectionFormula
Remarks Use this method to check the group selection formula for the report
for errors. This method works just like the Check button in the
Formula Editor. If the group selection formula contains an error, the
method returns FALSE.
Class CRPEJob
Related Topics
PECheckGroupSelectionFormula 435
CRPEJob::GetNGroups
Remarks Use this method to fetch the number of group sections in the report.
Return Value The number of group sections in the report. Returns -1 if an error
occurs.
Class CRPEJob
Related Topics
PEGetNGroups 478
CRPEJob::GetGroupCondition
Parameters sectionCode
Specifies the code for the report section for which you want to get the
grouping condition. Possible values are:
For group condition field types other than Date and Boolean, the
group condition value of the condition parameter is
PEP_GC_ANYCHANGE.
For a group condition field of the type Date, the group condition
value will be one of the following:
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
Related Topics
PEGetGroupCondition 465
CRPEJob::GetNParams
Remarks Use this method whenever you need to know how many parameters
are required by a stored procedure in a SQL database table. This
method is usually used in conjunction with CRPEJob::GetNthParam
or CRPEJob::SetNthParam.
Return Value The number of parameters in the current stored procedure being
used to generate the report.
Class CRPEJob
CRPEJob::GetNthParam
Parameters paramN
Specifies which parameter in the stored procedure you want to get
the value of. The first parameter of a stored procedure is 0, the
second is 1, etc.
paramValue
Retrieves the current value of the specified parameter in the stored
procedure.
Remarks Gets the Nth parameter of a stored procedure. Use this method
whenever you need to find out a particular parameter required by a
stored procedure in a SQL database table.
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
Related Topics
PEGetNthParam 494
CRPEJob::SetNthParam
Parameters paramN
Specifies which parameter in the stored procedure you want to set
the value of. The first parameter of a stored procedure is 0, the
second is 1, etc.
Remarks Sets the value of a parameter in a stored procedure. Use this method
when working with stored procedures in SQL database tables to set
the value of a parameter in a stored procedure. When passing
parameter values, All parameter values must be passed as string
values. If you wish to pass a numeric value, pass the value in quotes
like this: "100".
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
Related Topics
PESetNthParam 584
CRPEJob::GetPrintDate
Parameters year
Retrieves the year for the current print date.
month
Retrieves the month for the current print date.
day
Retrieves the day for the current print date.
Remarks Determines the print date (if any) that was specified with the report.
Use this method to fetch the print date and pass back using
CRPEJob::SetPrintDate.
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Related Topics
PEGetPrintDate 509
CRPEJob::GetPrintOptions
Parameters options
A pointer to a CRPEPrintOptions structure.
Remarks Retrieves the print options specified for the report (the options that
are set in the Print Setup common dialog box) and uses them to fill in
the CRPEPrintOptions structure. Use this function to fetch print
options from the report in order to update them and pass back using
CRPEJob::SetPrintOptions.
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
Related Topics
PEGetPrintOptions 510
CRPEJob::GetNDetailCopies
Parameters nCopies
Retrieves the current setting for the number of times the Details
section of the report will be printed.
Remarks Returns the number of copies of each Details section in the report
that are to be printed. Use this method to find out how many times
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
Related Topics
PEGetNDetailCopies 476
CRPEJob::GetMargins
BOOL GetMargins (short *left, short *right, short *top, short *bottom);
Parameters left
Retrieves the current setting of the left margin in twips.
right
Retrieves the current setting of the right margin in twips.
top
Retrieves the current setting of the top margin in twips.
bottom
Retrieves the current setting of the bottom margin in twips.
Remarks Retrieves the page margin settings for the specified report. Use this
method to find out what the currently set margins for the report are.
Use CRPEJob::SetMargins to change report margins.
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
Related Topics
PEGetMargins 473
Parameters sectionCode
Specifies the code for the report section for which you want to
retrieve the minimum height. Possible values are:
height
Retrieves the Nminimum height, in twips, for the specified report
section.
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Related Topics
PEGetMinimumSectionHeight 474
CRPEJob::GetSelectedPrinter
Parameters driverName
Retrieves the name of the printer driver for the currently selected
printer in the report.
printerName
Retrieves the name of the printer currently selected in the report.
portName
Retrieves the name of the port the currently selected printer is
attached to. For example, "LPT1:".
mode
A DEVMODE structure that contains information on the currently
selected printer, if the CRPEJob::GetSelectedPrinter method
completes successfully. For more information on the DEVMODE
structure, refer to the Microsoft Windows Software Development
Kit.
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
CRPEJob::GetSectionFormat
Parameters sectionCode
Specifies the code for the report section that you need to obtain
format information for. Possible values are:
options
A pointer to a CRPESectionOptionsstructure.
Remarks Retrieves the section format settings for a selected section in the
specified report and supplies the information by assigning values to
the members of the CRPESectionOptions structure. Use this method
in order to edit and update the section formats and pass information
back using CRPEJob::SetSectionFormat.
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Related Topics
PEGetSectionFormat 515
CRPEJob::SetSectionFormat
Parameters sectionCode
Specifies the code for the report section that you need to change
format information for. Possible values are:
options
A pointer to a CRPESectionOptions structure.
Remarks Sets the section format settings for selected sections in the specified
report to the values in the CRPESectionOptions structure. This
method can be used to provide specialized formatting for printing
invoices, form letters, printing to pre-printed forms, etc. It allows
you to hide a section, insert a page break either before or after a
section begins, reset the page number to 1 after a group value prints,
prevent page breaks from spreading data from a single record over
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
Related Topics
PESetSectionFormat 600
CRPEJob::GetGraphType
Parameters sectionCode
Specifies the section of the report containing the graph you want to
find out the type of. Possible values are:
graphN
Specifies which graph within the section you want to know the type
of. This value is 0 indexed. Within a section, graphs are numbered
from top to bottom, first, then from left to right if they have the same
top.
Remarks Identifies one of the available graph/chart types used for the
specified graph in the specified section. Use this method to find out
what type of graph is being displayed in the report. There are many
types of graphs and charts possible with Crystal Reports. This
method will return the type of graph or chart being displayed.
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
Related Topics
PEGetGraphType 463
Parameters sectionCode
Specifies the section of the report containing the graph you want to
change the type of. Possible values are:
graphN
Specifies which graph within the section you want to change the type
of. This value is 0 indexed. Within a section, graphs are numbered
from top to bottom, first, then from left to right if they have the same
top.
graphType
Specifies the style of the graph you want to set. Possible values are:
Remarks Changes the type of graph displayed for the specified graph in the
specified section based on one of the available graph/chart types.
Use this method to change the type of graph that is displayed in a
report.
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
Related Topics
PESetGraphType 569
CRPEJob::GetGraphData
Parameters sectionCode
Specifies the section of the report containing the graph you want to
get information from.
graphN
Specifies which graph within the section you want to get graph data
information from. This value is 0 indexed. Within a section, graphs
are numbered from top to bottom, first, then from left to right if they
have the same top.
graphDataInfo
A pointer to a CRPEGraphDataInfo structure.
Remarks Use this method to find out what data in your report is being used by
a specified graph when the graph is created. This information
includes which groups are used to create the rows and columns of
the graph and which summary field in the report is used to set the
values of the risers in the graph.
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
Related Topics
PEGetGraphData 458
Parameters sectionCode
Specifies the section of the report containing the graph you want to
change graph data information for. Possible values are:
graphN
Specifies which graph within the section you want to change graph
data information for. This value is 0 indexed. Within a section,
graphs are numbered from top to bottom, first, then from left to right
if they have the same top.
graphDataInfo
A pointer to a CRPEGraphDataInfo structure.
Remarks Use this method to change what data is used from your report to
create a specified graph. This information includes the groups used
to create the rows and columns of the graph and the summary field
used to set the values of the risers in the graph.
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Related Topics
PESetGraphData 564
CRPEJob::GetGraphText
Parameters sectionCode
Specifies the section of the report containing the graph you want to
get title text for. Possible values are:
graphN
Specifies which graph within the section you want to get title text for.
This value is 0 indexed. Within a section, graphs are numbered from
top to bottom, first, then from left to right if they have the same top.
graphTextInfo
A pointer to a CRPEGraphTextInfo structure.
Remarks This method allows you to find out what text appears with a graph.
A graph can have a title, subtitle, footnote, title for groups, title for
series, title for the X axis, title for the Y axis, and title for the Z axis (in
3D graphs).
Class CRPEJob
Related Topics
PEGetGraphText 461
CRPEJob::SetGraphText
Parameters sectionCode
Specifies the section of the report containing the graph you want to
change the text of.
Possible values are:
graphN
Specifies which graph within the section you want to change the text
of. This value is 0 indexed. Within a section, graphs are numbered
from top to bottom, first, then from left to right if they have the same
top.
Remarks This method allows you to set or change the text that appears with a
graph. A graph can have a title, subtitle, footnote, title for groups,
title for series, title for the X axis, title for the Y axis, and title for the
Z axis (in 3D graphs).
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
Related Topics
PESetGraphText 568
CRPEJob::GetGraphOptions
Parameters sectionCode
Specifies the section of the report containing the graph you want to
get graph display options for. Possible values are:
Remarks Use this method to obtain information about any of several graph
options. These options include the minimum and maximum values
that can appear on the graph, whether grid lines appear, whether
risers are labeled, whether bar graphs have horizontal or vertical
bars, and whether a legend appears on the graph.
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
Related Topics
PEGetGraphOptions 459
CRPEJob::SetGraphOptions
Parameters sectionCode
Specifies the section of the report containing the graph you want to
change display options for. Possible values are:
Remarks Use this function to change any of several graph options. These
options include the minimum and maximum values that can appear
on the graph, whether grid lines appear, whether risers are labeled,
whether bar graphs have horizontal or vertical bars, and whether a
legend appears on the graph.
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
Related Topics
PESetGraphOptions 566
CRPEJob::GetNthGroupSortField
Parameters sortFieldN
Specifies the number of the group sort field you want to retrieve. The
first group sort field is field 0. If the report has N sort fields, the
function can be called with sortFieldN between 0 and N-1.
Remarks Returns information about one of the group sort fields in the
specified report: that is, it returns the name of the field and the
direction (ascending or descending) of the sort. This method is
typically used as one of a series: CRPEJob::GetNGroupSortFields
(called once), CRPEJob::GetNthGroupSortField (called as many
times as needed to identify the correct group sort field), and
CRPEJob::SetNthGroupSortField (called once when the correct sort
field is identified). The series can be used to identify and then change
an existing group sort field and/or sort order at print time in
response to a user selection.
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
Related Topics
PEGetNthGroupSortField 492
CRPEJob::ShowNthPage
Parameters pageN
Specifies the page number of the report that should be displayed in
the Preview window.
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
Related Topics
PEShowNthPage 610
CRPEJob::DiscardSavedData
Remarks Discards data that was previously saved with the report. If a report
has been saved with data, you can use this function to discard the
saved data, forcing the Report Engine to retrieve new data when the
report is printed.
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
Related Topics
PEDiscardSavedData 446
CRPEJob::GetNthParamInfo
Parameters paramN
Specifies the number of the stored procedure parameter about which
you want to gather information.
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
Related Topics
PEGetNthParamInfo 497
CRPEJob::GetNSections
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
Related Topics
PEGetNSections 484
Parameters printJob
Specifies the handle of the print job from which you want to identify
a section code.
sectionN
Specifies the number of the section for which you want the section
code. See Working with section codes, Page 428.
Remarks The GetSectionCode function retrieves the section code for the
specified section. A section code indicates the section type (Page
Header, Details, and so forth). If there are multiple group sections it
also identifies the group number, and if there are multiple sections in
an area it identifies the section number.
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
Related Topics
PEGetSectionCode 513
CRPEJob::HasSavedData
Parameters printJob
Specifies the handle to the print job you want to query to find if it has
saved data.
hasSavedData
Specifies a pointer to a memory address that indicates whether or not
there is data saved with the report.
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
Related Topics
PEHasSavedData 526
CRPEJob::GetNPages
Remarks The GetNPages function retrieves the number of pages in the report.
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
Related Topics
PEGetNPages 481
CRPEJob::SetDialogParentWindow
Parameters parentWindow
A pointer to the CWnd object that is to be the parent of the Preview
Window when the report is printed to a Preview Window.
Class CRPEJob
Related Topics
PESetDialogParentWindow 556
CRPEJob::EnableProgressDialog
Parameters printJob
Specifies the handle to the print job for which you want to enable/
disable the progress dialog box..
enable
Specifies whether or not the progress dialog box is enabled. If enable
is set to TRUE (1), the progress dialog box is enabled. If it’s set to
FALSE (0), the dialog box is disabled.
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
Related Topics
PEEnableProgressDialog 447
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
Related Topics
PEGetNParameterFields 482
CRPEJob::GetNthParameterField
Parameters parameterN
Specifies the number of the parameter field about which you want to
retrieve information.
parameterInfo
A pointer to a CRPEParameterFieldInfo structure.
Class CRPEJob
Related Topics
PEGetNthParameterField 496
CRPEJob::SetNthParameterField
Parameters parameterN
Specifies the number of the parameter field about which you want to
retrieve information.
parameterInfo
A pointer to a CRPEParameterFieldInfo structure.
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
Related Topics
PESetNthParameterField 586
CRPEJob::GetNSubreportsInSection
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
Related Topics
PEGetNSubreportsInSection 487
Working with subreports 36
CRPEJob::GetNthSubreportInSection
Parameters sectionCode
Specifies the code for the report section that contains the subreport.
See Working with section codes, Page 428.
subreportN
Specifies the number of the subreport in the specified section.
subreportN is zero based. The first report in the section will be 0, the
second will be 1, etc. If there are no subreports in the section, the
function will return 0.
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
CRPEJob::OpenSubreportJob
Parameters subreportName
Specifies the name of the subreport you want to access. This name is
retrieved using CRPEJob::GetSubreportInfo.
Class CRPEJob
Related Topics
PEOpenSubreport 539
Working with subreports 36
The Report Engine As mentioned above, the Crystal NewEra Class Library classes are
wrapped around the Crystal Report Engine API (Page 15), and the
API methods in these classes make direct calls to the functions in the
Report Engine API.
The Crystal The Crystal NewEra Class Library consists of two primary classes.
The CRPEngine class is designed so that there should only be one
NewEra Class CRPEngine object in the entire application. The CRPEngine object
Library classes contains methods that are common to all print jobs (e.g. SQL
connections, version information, etc.). More importantly, it is
responsible for creating and managing all CRPEJob objects. It is the
CRPEJob object that allows you access to the attributes of a print job.
Both of the classes are derived from the Microsoft MFC Library
CObject class and provide all of the functionality of that class,
including runtime class information and object diagnostic output.
CLASS CRPELogOnInfo
This class is used by member functions CRPEngine::LogOnServer,
CRPEngine::LogOffServer, CRPEJob::GetNthTableLogonInfo,
CRPEJob::SetNthTableLogonInfo. The class is used to contain SQL
connection information.
Construction CRPELogOnInfo
Constructs a CRPELogOnInfo class object.
CRPELogOnInfo::CRPELogOnInfo
CRPELogOnInfo ();
CRPELogOnInfo ( serverName CHAR (*), databaseName CHAR (*),
userID CHAR (*), password CHAR (*));
Parameters serverName
Specifies the logon name for the server or ODBC Datasource Name
used to logon to the server .
Assigns this value to the CRPELogOnInfo::m_serverName member.
databaseName
Specifies the logon name for the database used to run the report.
Assigns this value to the CRPELogOnInfo::m_databaseName
member.
userID
Specifies the user I.D. necessary to log on to the server.
Assigns this value to the CRPELogOnInfo::m_userID member.
password
Specifies the password necessary to log on to the server.
Assigns this value to the CRPELogOnInfo::m_password member.
Class CRPELogOnInfo
CLASS CRPEJobInfo
This class is used by the CRPEJob::GetJobStatus member function.
Status information concerning the job is returned through this class.
Construction CRPEJobInfo
Constructs a CRPEJobInfo class object:
All INTEGERs & SMALLINTs initialized to zero, printEnded
initialized to FALSE
Class CRPEJobInfo
CLASS CRPETableType
This class is used to determine information about a specific table
used in the report. It is used by the
CRPEJob::GetNthTableSessionInfo.
Construction CRPETableType
Constructs a CRPETableType class object.
CRPETableType::CRPETableType
CLASS CRPESessionInfo
This class is used to get and set the session information (user id and
password) for password protected Microsoft Access databases. It is
used with the CRPEJob:GetNthTableSessionInfo and
CRPEJob::SetNthTableSessionInfo member functions.
Construction CRPESessionInfo
Constructs a CRPESessionInfo class object.
CRPESessionInfo::CRPESessionInfo
CRPESessionInfo ();
CRPESessionInfo (userID CHAR(*) : NULL, password CHAR(*) :
NULL, sessionHandle INTEGER : 0);
Parameters userID
Specifies the user I.D. needed for logging on to the MS Access
system. Assigns this value to the CRPESessionInfo::m_userID
member.
password
Specifies the password needed for logging on to the MS Access
system. Assigns this value to the CRPESessionInfo::m_password
member.
sessionHandle
The handle to the current MS Access session. Assigns this value to
the CRPESessionInfo::m_sessionHandle member.
Class CRPESessionInfo
CLASS CRPETableLocation
This class is used to get and set table location information. It is used
with the CRPEJob::GetNthTableLocation and
CRPEJob::SetNthTableLocation functions.
Construction CRPETableLocation
Constructs a CRPETableLocation class object.
CRPETableLocation::CRPETableLocation
Parameters location
Specifies the database location. Assigns this value to the
CRPETableLocation::m_location member.
Class CRPETableLocation
CLASS CRPEPrintOptions
This class is used to set the print characteristics of a report. It is used
with the CRPEJob::SetPrintOptions member function.
Construction CRPEPrintOptions
Constructs a CRPEPrintOptions class object.
CRPEPrintOptions::CRPEPrintOptions
CRPEPrintOptions ();
CRPEPrintOptions (startPageN SMALLINT : 0, stopPageN
SMALLINT : 0, nReportCopies SMALLINT : 0, collation SMALLINT :
PEP_DEFAULTCOLLATION);
Parameters startPageN
Specifies the first page that you want to print. Assigns this value to
the CRPEPrintOptions::m_startPageN member.
stopPageN
Specifies the last page that you want to print. Assigns this value to
the CRPEPrintOptions::m_stopPageN member.
nReportCopies
Specifies the number of copies that you want to print. Assigns this
value to the CRPEPrintOptions::m_nReportCopies member.
collation
Indicates whether or not you want the copies of the report to be
collated (if you are printing multiple copies of a multiple page report.
Assigns this value to the CRPEPrintOptions::m_collation member.
Class CRPEPrintOptions
CLASS CRPEExportOptions
This class is used to get and set the export options of a print job. It is
used by member functions CRPEJob::GetExportOptions and
CRPEJob::ExportTo.
Construction CRPEExportOptions
Constructs a CRPEExportOptions class object.
CRPEExportOptions::CRPEExportOptions
CRPEExportOptions ();
CRPEExportOptions (formatDLLName CHAR(*) : NULL, formatType
INTEGER: 0, formatOptions FOREIGN : NULL, destinationDLLName
CHAR(*) : NULL, destinationType INTEGER : 0, destinationOptions
FOREIGN : NULL);
Parameters formatDLLName
Specifies the name of the format DLL that contains the export format
to be used. Assigns this value to the
CRPEExportOptions::m_formatDLLName member. Select a DLL
from the following table:
destinationDLLName
Specifies the name of the destination DLL that contains the
destination type to be used. Assigns this value to the
CRPEExportOptions::m_destinationDLLName member. The
following options are available:
destinationType
Specifies the destination type of the exported report. Assigns this
value to the CRPEExportOptions::m_destinationType member.
destinationOptions
Provides additional information specific to the export destination
type. Assigns this value to the
CRPEExportOptions::m_destinationOptions member. If you assign
NULL to this parameter, the Report Engine will automatically
prompt the user for destination information when needed.
Otherwise, use a destination options class from thefollowing table:
Class CRPEExportOptions
CLASS CRPESectionOptions
This class contains specifications for formatting selected report
sections. This information is used by the methods
CRPEJob::GetSectionFormat and CRPEJob::SetSectionFormat.
Construction CRPESectionOptions
Constructs a CRPESectionOptions class object.
CRPESectionOptions::CRPESectionOptions
Class CRPESectionOptions
CLASS CRPEGraphDataInfo
The CRPEGraphDataInfo class contains information on what report
data is used by a graph in the report to create the values in the graph.
The class is used by CRPEJob::GetGraphData to retrieve information
regarding an existing graph and by CRPEJob::SetGraphData to
change the data used by an existing graph.
Construction CRPEGraphDataInfo
Constructs a CRPEGraphDataInfo class object.
Parameters rowGroupN
Specifies which group number in the report is used to create the
values in the rows of the graph. Assigns this value to the
CRPEGraphDataInfo::m_rowGroupN member variable.
colGroupN
Specifies which group number in the report is used to create the
values in the columns of the graph. Assigns this value to the
CRPEGraphDataInfo::m_colGroupN member variable.
summarizedFieldN
Specifies which summary field in the report is used to set the values
of the risers in the graph. Summary fields are numbered in order of
their creation. Assigns this value to the
CRPEGraphDataInfo::m_summarizedFieldN member variable.
graphDirection
Specifies the graphing direction for Cross-Tab reports. For normal
group/total report, the direction, is always
PEP_GRAPH_COLS_ONLY = 1. Assigns this value to the
CRPEGraphDataInfo::m_graphDirection member variable. Possible
values are:
Class CRPEGraphDataInfo
CLASS CRPEGraphTextInfo
The CRPEGraphTextInfo class contains information about the text
that appears with a graph. This class is used with the methods
CRPEJob::GetGraphText and CRPEJob::SetGraphText.
Construction CRPEGraphTextInfo
Constructs a CRPEGraphTextInfo class object.
CRPEGraphTextInfo ();
CRPEGraphTextInfo (graphSubTitle CHAR(*) : NULL, graphFootNote
CHAR(*) : NULL, graphGroupsTitle CHAR(*) : NULL, graphSeriesTitle
CHAR(*) : NULL, graphXAxisTitle CHAR(*) : NULL, graphYAxisTitle
CHAR(*) : NULL, graphZAxisTitle CHAR(*) : NULL);
Parameters graphTitle
Specifies the main title text that will appear above your graph.
Assigns this title to the CRPEGraphTextInfo::m_graphTitle member
variable.
graphSubTitle
Specifies the sub title text that will appear directly under the main
title. Assigns this title to the CRPEGraphTextInfo::m_graphSubTitle
member variable.
graphFootNote
Specifies the footnote text that will appear under your graph.
Assigns this text to the CRPEGraphTextInfo::m_graphFootNote
member variable.
graphGroupsTitle
Specifies the title of the groups which are being graphed. Assigns
this title to the CRPEGraphTextInfo::m_graphGroupsTitle member
variable.
graphSeriesTitle
Specifies the title of the series which is being graphed. Assigns this
title to the CRPEGraphTextInfo::m_graphSeriesTitle member
variable.
graphXAxisTitle
Specifies the title text that will appear for the X axis. Not valid for Pie
graphs. Assigns this title to the
CRPEGraphTextInfo::m_graphXAxisTitle member variable.
graphYAxisTitle
Specifies the title text that will appear for the Y axis. Not valid for Pie
graphs. Assigns this title to the
CRPEGraphTextInfo::m_graphYAxisTitle member variable.
Class CRPEGraphTextInfo
CLASS CRPEGraphOptions
Construction CRPEGraphOptions
Constructs a CRPEGraphOptions class type.
CRPEGraphOptions::CRPEGraphOptions
Parameters graphMaxValue
Specifies the maximum value that will appear in the graph. Any
graph values above this value are not charted. Assigns this value to
the CRPEGraphOptions::m_graphMaxValue member variable.
graphMinValue
Specifies the minimum value that will appear in the graph. Any
graph values below this value are not charted. Assigns this value to
the CRPEGraphOptions::m_graphMinValue member variable.
showDataValue
Specifies whether or not to display the numerical value associated
with each riser on the chart. If set to TRUE, a value appears in the
graph for each riser. Assigns this value to the
CRPEGraphOptions::m_showDataValue member variable.
showGridLine
Specifies whether or not to display grid lines on the graph. Assigns
this value to the CRPEGraphOptions::m_showGridLine member
variable.
verticalBars
Specifies whether to display the bars in a bar graph vertically or
horizontally. Assigns this value to the
CRPEGraphOptions::m_verticalBars member variable.
Class CRPEGraphOptions
CLASS CRPEngine
The CRPEngine class is designed so that there should only be one
CRPEngine object in the entire application. The CRPEngine class
contains methods that are common to all print jobs (e.g. SQL
connections, version information, etc.). More importantly, it is
responsible for creating and managing all CRPEJob objects. It is the
CRPEJob object that allows you access to the attributes of a print job.
In order to open a particular report it is first necessary to have an
open Report Engine object in the application. You may then call the
CRPEngine::OpenPrintJob member function specifying the report
file name to open. If successful, you will be returned a pointer to a
CRPEJob object.
Construction CRPEngine
Constructs a CRPEngine object.
Engine
Management Open Loads the engine
Server
Management LogOnServer Logs on to server
Uses an existing
LogOnSQLServerWithPrivateInfo connection to a SQL
Server.
Error
Management Get a number indicating the status
GetErrorCode
of the most recent function called
Functions Inquire on the error text
GetErrorText
CLASS CRPEJob
In order to open a particular report it is first necessary to have an
open Report Engine object in the application. You may then call the
CRPEngine::OpenPrintJob member function specifying the report
file name to open. If successful, you will be returned a pointer to a
CRPEJob object. It is through this object that you may modify the
print job attributes as well as output the report in various formats.
Almost all of these methods correspond to similar functions
available in the Crystal Report Engine API. Full documentation on
what these methods are used for are available in the Developer’s on-
line help.
Construction CRPEJob
Constructs a CRPEJob object. Used internally by
CRPEngine::OpenJob.
Preview Window
Customization Displays the first page in the
ShowFirstPage
Preview Window
Functions Displays the previous page in
ShowPreviousPage
the Preview Window
Displays the last page in the
ShowLastPage
Preview Window
Displays the print controls in
ShowPrintControls
the Preview Window
Checks if the print controls are
PrintControlsShowing displayed in the Preview
Window .
Changes Preview Window
ZoomPreviewWindow magnification to a specified
level
Changes Preview Window
NextWindowMagnification magnification to the next level
in order
Preview Window
Management PrintWindow Prints contents of print window
Formula Functions
Finds the number of formulas in
GetNFormulas
the report to be printed.
Gets a formula’s text and name
GetNthFormula
(formula specified by number).
Get a formula’s text (formula
GetFormula
specified by name).
Set the formula text of a formula
SetFormula
(formula specified by name).
Checks text of a formula for
CheckFormula validity (formula specified by
name).
Selection Formula
Functions Get the record selection
GetSelectionFormula
formula
Set the record selection
SetSelectionFormula
formula
Checks text of record
CheckSelectionFormula selection formula for
validity.
Group
Management Finds the number of groups in the
GetNGroups
report.
Functions Gets the condition information for
GetGroupCondition
the specified report group.
Changes the group condition for a
SetGroupCondition
group section
Sorting Functions
Finds the number of sort fields in
GetNSortFields
the report to be printed
GetNthSortField Gets the specified sort field
Server
Management Returns the current SQL query for
GetSQLQuery
the report
Functions Sets a new SQL query for the report
SetSQLQuery
Print Format
Management Gets the title string for the
GetReportTitle
current report
Functions Changes the report title to
SetReportTitle the string you supply as a
parameter
Gets the print date set for
GetPrintDate
the report.
Sets a print date different
SetPrintDate from the system calender
date
Gets print options set for
GetPrintOptions
specified report.
Sets print options for the
SetPrintOptions
specified report
Gets format information for
GetSectionFormat
specified section.
Sets format information for
SetSectionFormat
specified section.
Gets the number of times
GetNDetailCopies each detail section is to be
printed.
Prints specified number of
SetNDetailCopies copies of the details section
of the report
Gets page margins set in
GetMargins
specified report.
SetMargins Sets margins for the report
Print Destination
Functions Selects a printer other than the
SelectPrinter
default printer
Returns the printer currently
GetSelectedPrinter
selected in the report.
Prepares a direct output to the
OutputToWindow
print window
Prepares a direct output to a
OutputToPrinter
selected printer
ExportTo Prepares to export a file
Graph/Chart
Management Identifies which graph/chart type
GetGraphType
is used for a graph.
Functions Changes which graph/chart type is
SetGraphType
used for a graph.
Identifies the data on which a
GetGraphData
graph is based.
Changes the data on which a graph
SetGraphData
is based.
Gets the identifying text that
GetGraphText
appears on a graph.
Changes the identifying text that
SetGraphText
appears on a graph.
Error
Management Get a number indicating the status
GetErrorCode
of the most recent function called
Functions Inquire on the error text
GetErrorText
CRPEngine::CRPEngine
Parameters v_open
Indicates whether or not the Report Engine should be opened when
the CRPEngine object is created.
Remarks This is the constructor for the class. If open is true, the actual Crystal
Reports DLL is opened (crpe32.dll). Print jobs may only be opened
if the engine itself is open. If originally opened with open = FALSE,
the engine may be opened later with the CRPEngine::Open method.
Class CRPEngine
CRPEngine::Open
Remarks This method opens the Crystal Report Engine. This method is only
necessary if you constructed the CRPEngine object with the open
parameter equal to FALSE. If you set the open parameter to TRUE
when you constructed the CRPEngine object, this method is
unnecessary.
Return Value Returns TRUE if the Report Engine was opened successfully, FALSE
if something went wrong.
Class CRPEngine
CRPEngine::Close
Class CRPEngine
Related Topics
PECloseEngine
CRPEngine::GetVersion
Parameters versionRequested
Specifies whether the version number of the Report Engine or the
Report Engine DLL is being requested. Possible values are:
Remarks This method returns the version number of the Report Engine dll
(crpe32.dll) or the version of the Report Engine itself. The high-order
byte is the major version number and the low-order byte is the minor
version number.
This method can be used whenever you build functionality into a
report that may not be available in earlier versions of the Report
Engine and you need to verify the version number first. The function
can be a handy safeguard for users who have more than one version
of the Report Engine with the older version earlier in the path than
the new version.
Class CRPEngine
Related Topics
PEGetVersion
CRPEngine::GetEngineStatus
Remarks This method may be used to get the current engine status. Possible
values returned are:
engineOpen
The Report Engine is currently open.
engineClosed
The Report Engine has been closed, or is not yet open.
engineMissing
No Report Engine is available. Make sure the Report Engine DLL is
located in a directory that appears in your PATH.
Return Value A value of the Status enumerated type. Indicates the current status of
the Report Engine.
Class CRPEngine
CRPEngine::OpenJob
Parameters reportFileName
The name and path (if necessary) of the report file being opened for
the specified print job.
Class CRPEngine
Related Topics
PEOpenPrintJob
CRPEngine::PrintReport
Parameters reportFilePath
Specifies the name and path of the report to be printed.
toPrinter
Specifies whether or not the report is to be sent to the default printer.
toWindow
Specifies whether or not the report is to be displayed in a Preview
Window .
title
Specifies the title you want to appear in the title bar if the report is
being sent to a Preview Window .
left
Specifies the x coordinate of the upper left hand corner of the
Preview Window, in device coordinates.
top
Specifies the y coordinate of the upper left hand corner of the
Preview Window, in device coordinates.
Remarks This method provides a quick but limited way to print a report. The
report may only be output to a printer or Preview Window . Use this
class method any time you simply want to print a report from an
application without giving the user the ability to customize the
report.
Return Value 0 if the call is successful. Returns an error code if something goes
wrong.
Class CRPEngine
Related Topics
PEPrintReport (C Syntax)
CRPEngine::LogOnServer
Parameters dllName
Specifies the name of the Crystal Reports DLL for the server or
password protected non-SQL table you want to log onto.
Remarks This method opens a connection to a SQL server. More than one
print job may use this connection to a SQL server. Information
required to establish a connection is provided through the
CRPELogOnInfo class.
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEngine
Related Topics
PELogOnServer
CRPEngine::LogOffServer
Parameters dllName
Specifies the name of the Crystal Reports DLL for the server or
password protected non-SQL table you want to log onto.
logOnInfo
Specifies a pointer to a CRPELogOnInfo class.
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEngine
CRPEngine::LogOnSQLServerWithPrivateInfo
Parameters dllName
Specifies the name of the Crystal Reports DLL that was used when
establishing a connection to the Server when the report was first
created. For example, if a report was created using an ODBC data
source, specify the filename "PDSODBC.DLL". For more information
on possible database DLLs, refer to Runtime File Requirements in
RUNTIME.HLP.
privateInfo
Specifies the application’s handle to the Server connection. In your
application, a connection to the Server must already be established
before this method is called. Pass the HDBC (handle to a database
connection) from this connection to the privateInfo parameter.
Remarks Use this class method to allow the Crystal Report Engine to
"piggyback" your application’s existing connection to a Server. This
lowers the number of connections established by a workstation,
reducing application time and network traffic. It also prevents a
Crystal Reports Log Off call from disconnecting an application’s
existing connection to the Server.
The CRPEngine::LogOnSQLServerWithPrivateInfo method can
only be used with database connections established by ODBC or
Q+E Library 2.0. Any other database connections can not be accessed
by this method.
To obtain an HDBC for an ODBC connection, use the following
function calls (see the ODBC SDK 2,0 manual for more information):
SQLAllocEnv
Initializes the ODBC call level interface and allocates memory for an
environment handle.
SQLAllocConnect
Returns an ODBC HDBC
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEngine
CRPEngine::CanClose
Remarks Checks to see whether or not the Report Engine is busy. Errors can
occur in your application or on a system if you attempt to close the
Report Engine while it is processing a print job. Use this method
before attempting to close the Report Engine in an application (for
example, when the user tries to exit) to determine if the Report
Engine can be closed safely.
Return Value TRUE if the Report EngineReport Engine can be closed, FALSE if the
Report Engine is still busy.
Class CRPEngine
CRPEngine::GetNPrintJobs
Remarks This method returns the number of print job (CRPEJob) objects that
currently exist for the current CRPEngine object.
Return Value The number of CRPEJob objects currently open. Returns -1 if an error
occurs.
CRPEngine::GetErrorCode
Remarks This method returns the current error code of the Report Engine.
When a call to another function fails, this call gets the error code that
was generated so you can take some action based on that error code.
Return Value The current Report Engine error code. 0 if no error has occurred.
Class CRPEngine
Related Topics
PEGetErrorCode
CRPEngine::GetErrorText
Return Value A CString object containing the text for the current error.
Class CRPEngine
Related Topics
PEGetErrorText
CRPEJob(jobHandle SMALLINT);
Parameters jobHandle
Handle to the job created by CRPEngine::OpenJob().
Remarks This is the constructor for the class. It also stores the job number
internally for future use in Report Engine API calls.
NOTE: This class constructor is automatically called by
CRPEngine::OpenJob(). Do not call this constructor from within
your own code.
Class CRPEJob
CRPEJob::StartJob
Remarks This method is used to start the processing of the print job and
display the final output of that processing. This is the method that
actually prints or exports the report.
Return Value TRUE if the job is started successfully, FALSE if something goes
wrong.
Class CRPEJob
Related Topics
PEStartPrintJob
Remarks This method closes the print job. It also calls the destructor for the
CRPEJob object. If printing has not yet finished when this method is
called, it continues until the job is completely printed. If the Preview
Window is open, it stays open.
Class CRPEJob
Related Topics
PEClosePrintJob
CRPEJob::Cancel
Class CRPEJob
Related Topics
PECancelPrintJob (C Syntax)
CRPEJob::GetJobStatus
Remarks This method gets the current status of the print job. You can use it in
a number of programming situations, for example:
to trigger error messages, i.e., when a print job fails (due to
insufficient memory, insufficient disk space, etc.) or,
to trigger screen displays (hourglass, series of graphics, etc.)
that confirm to the user that work is in progress.
to find out whether a job was cancelled by the user after
CRPEJob::Start was called.
CRPEJobInfo
Class CRPEJobInfo.
Class CRPEJob
Related Topics
PEGetJobStatus
CRPEJob::IsJobFinished
Remarks This method returns a Boolean value that indicates whether or not
processing has finished for the print job. You can use this method
any time you have a call that is contingent on a print job being
finished.
Return Value TRUE if processing has finished, FALSE if the job is in progress.
Class CRPEJob
Related Topics
PEIsPrintJobFinished
Remarks This method returns the job handle for the print job.
Return Value The print job handle for the CRPEJob object.
Class CRPEJob
CRPEJob::ShowNextPage
Remarks This method shows the next page in the Preview Window . Use this
method to customize how a user moves through pages in a report.
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
Related Topics
PEShowNextPage
CRPEJob::ShowFirstPage
Remarks This method shows the first page in the Preview Window . Use this
method to customize how a user moves through pages in a report.
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
CRPEJob::ShowPreviousPage
Remarks This method shows the previous page in the Preview Window . Use
this method to customize how a user moves through pages in a
report.
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
Related Topics
PEShowPreviousPage
CRPEJob::ShowLastPage
Remarks This method shows the last page in the Preview Window . Use this
method to customize how a user moves through pages in a report.
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
Related Topics
PEShowLastPage
Parameters showControls
TRUE indicates default Print controls are to be displayed in the
Preview Window. FALSE indicates no controls are to be displayed.
Remarks This method toggles the display of the Preview Window control
buttons. Use this to display default controls, or to hide default
controls and provide customized controls.
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
Related Topics
PEShowPrintControls
CRPEJob::ZoomPreviewWindow
Parameters level
The magnification level to which the Preview Window is to be
"zoomed". Use one of the following values:
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
Related Topics
PEZoomPreviewWindow
CRPEJob::NextWindowMagnification
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
Related Topics
PENextPrintWindowMagnification
CRPEJob::PrintWindow
Remarks This method prints the report displayed in the Preview Window to
the printer. If you are customizing Preview Window controls, use
this method to enable the user to preview the report in the Preview
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
Related Topics
PEPrintWindow
CRPEJob::ExportPrintWindow
Parameters toMail
Specifies whether or not the report file should be exported to an E-
mail address. If TRUE, the file is exported to E-mail. If FALSE, the file
is exported to a disk file.
Remarks This method exports the report displayed in the Preview Window to
a disk file or E-mail address. If you are customizing Preview
Window controls, use this method to enable the user to preview the
report in the Preview Window , and if everything looks satisfactory,
to export the report to a disk file or E-mail address (in response to a
user event - button click, menu command, etc.).
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
Remarks This method closes the Preview Window . If you are customizing
Preview Window controls, implement this method to allow the user
to close the Preview Window when finished viewing the report.
Class CRPEJob
Related Topics
PECloseWindow
CRPEJob::TestNthTableConnectivity
Parameters tableN
Specifies the number of the table for which you want to test the
connection settings. The first table added to a report is numbered 0,
the second is 1, etc.
Remarks This method tests to see if a valid connection exists to the database
for the specified table in the report. This method is typically used if
you plan to print at a later time, but you want to test now to make
sure everything is in order for logging on to the database table.
Return Value TRUE if the database session, log on, and location info. is all correct.
FALSE if something is wrong.
Class CRPEJob
Related Topics
PETestNthTableConnectivity
Return Value The number of tables used in the report. Returns -1 if an error occurs.
Class CRPEJob
Related Topics
PEGetNTables
CRPEJob::GetNthTableType
Parameter tableN
0 indexed table number indicating which table in the report for
which you want to determine the type.
Remarks This method gets table type information for the specified table.
Class CRPEJob
Related Topics
PEGetNthTableType
Parameters tableN
A 0 indexed table number indicating which MS Access table in the
report you wish to obtain the session information for.
Remarks This methods gets session information for the specified Microsoft
Access table. Many MS Access database tables require that a session
be opened before the information in the table can be used. Use this
method to obtain the session information (User ID and Session
Handle) for a particular tab.
Class CRPEJob
Related Topics
PEGetNthTableSessionInfo
CRPEJob::SetNthTableSessionInfo
Parameters tableN
0 indexed table number indicating which MS Access table in the
report the session is being opened for.
sessionInfo
A pointer to a CRPESessionInfo class.
Remarks This methods sets session information for the specified Microsoft
Access table. Many MS Access database tables require that a session
be opened before the table can be used. Use this method to open the
session.
Return Value TRUE if the call is successful, FALSE if anything goes wrong.
Class CRPEJob
Related Topics
PESetNthTableSessionInfo
CRPEJob::GetNthTableLocation
Parameters tableN
Specifies the 0 indexed number of the table for which you want to
retrieve location information.
Remarks This method gets table location information for the specified table in
the report. This method is typically combined with the
CRPEJob::SetNthTableLocation method to identify the location of a
table and then to change it.
Class CRPEJob
CRPEJob::SetNthTableLocation
Parameters tableN
Specifies the 0 indexed number of the table for which you want to set
a new location.
tableLocation
A pointer to a CRPETableLocation class.
Remarks This method sets table location information for the specified table in
the report. This method is typically combined with the
CRPEJob::GetNthTableLocation method to identify the location of a
table and then to change it.
Return Value TRUE if the call is successful, FALSE if anything goes wrong.
Class CRPEJob
Related Topics
PESetNthTableLocation
CRPEJob::GetNthTableLogOnInfo
Parameters tableN
Specifies the 0 indexed number of the table from which you want to
get log on information.
Class CRPEJob
Related Topics
PEGetNthTableLogOnInfo
CRPEJob::SetNthTableLogOnInfo
Parameters tableN
Specifies the 0 indexed number of the table for which you want to set
log on information.
logonInfo
A pointer to a CRPELogOnInfo class.
propagate
TRUE or FALSE value indicating whether the log on information
should be used for opening all tables being used in the report.
Remarks This method sets SQL connection information for the specified table.
The propagate flag may be used to cause the change to affect all
tables with similar server and database properties.
Return Value TRUE if the call is successful, FALSE if anything goes wrong.
Class CRPEJob
CRPEJob::GetFormula
Parameters formulaName
The name of the formula for which you want to retrieve the formula
string.
Remarks This method returns the formula text for the specified formula.
CRPEJob::GetFormula is often used with CRPEJob::SetFormula to
identify and then change an existing formula at print time in
response to a user selection.
Class CRPEJob
Related Topics
PEGetFormula
CRPEJob::SetFormula
Parameters formulaName
The name of the formula for which you want to assign new formula
text.
Remarks This method sets the formula text for the specified formula.
CRPEJob::SetFormula is often used with CRPEJob::GetFormula to
identify and then change an existing formula at print time in
response to a user selection.
Return Value TRUE if the call is successful, FALSE if the named formula does not
exist in the report, or there is an error in the formula.
Class CRPEJob
Related Topics
PESetFormula
CRPEJob::GetSelectionFormula
Remarks This method returns the formula text for the record selection
formula. CRPEJob::GetSelectionFormula is often used with
CRPEJob::SetSelectionFormula to identify and then change an
existing selection formula at print time in response to a user
selection.
Class CRPEJob
Related Topics
PEGetSelectionFormula
Parameters formulaText
Specifies the new selection formula to be assigned to the report.
Remarks This method sets the formula text for the record selection formula.
CRPEJob::SetSelectionFormula is often used with
CRPEJob::GetSelectionFormula to identify and then change an
existing selection formula at print time in response to a user
selection.
Return Value TRUE if the call is successful, FALSE if something goes wrong, or
there is an error in the formula.
Class CRPEJob
Related Topics
PESetSelectionFormula
CRPEJob::GetGroupSelectionFormula
Remarks This method returns the formula text for the group selection formula.
CRPEJob::GetGroupSelectionFormula is often used with
CRPEJob::SetGroupSelectionFormula to identify and then change an
existing group selection formula at print time in response to a user
selection.
Class CRPEJob
CRPEJob::SetGroupSelectionFormula
Parameters formulaText
Specifies the new group selection formula to be assigned to the
report.
Remarks This method sets the formula text for the group selection formula.
CRPEJob::SetGroupSelectionFormula is often used with
CRPEJob::GetGroupSelectionFormula to identify and then change
an existing group selection formula at print time in response to a user
selection.
Return Value TRUE if the call is successful, FALSE if something goes wrong, or
there is an error in the formula.
Class CRPEJob
Related Topics
PESetGroupSelectionFormula
CRPEJob::SetGroupCondition
Parameters sectionCode
Specifies the code for the group section for which you want to set the
group condition. Select a section from the table below:
Remarks This method sets the condition of the grouping for the specified
group section. This method can only replace the group condition for
an existing group. It can not create a new group. Use this function
whenever you want to change the grouping at print time, for
example, to print one report grouped in several different ways.
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
Related Topics
PESetGroupCondition
CRPEJob::GetNSortFields
Remarks This method gets the number of sort fields in the report.
Class CRPEJob
Related Topics
PEGetNSortFields
CRPEJob::GetNthSortField
Parameters sortFieldN
Specifies the number of the sort field you want to retrieve. The first
sort field added to the report is field 0, the second is 1, etc.
Remarks This method gets the name of the sort field at the specified sort field
position and the direction in which data is sorted (ascending or
descending).
Class CRPEJob
CRPEJob::SetNthSortField
Parameters sortFieldN
Specifies the number of the sort field you want to set. The first sort
field added to the report is field 0, the second is 1, etc. If the report
has N sort fields, the function can be called with this parameter
between 0 and N-1 to replace an existing sort field. Call the function
with this parameter equal to N to add a new sort field.
field
Specifies the name of the field to be sorted.
direction
Specifies the sort direction. The following values are possible:
Remarks This method sorts report data according to the specified field and
direction.
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
Related Topics
PESetNthSortField
Parameters sortFieldN
Specifies the number of the sort field you want to delete. The first sort
field added to the report is field 0, the second is 1, etc.
Remarks This method deletes the specified sort field from the report. The field
is not deleted from the report, but it is removed from the list of sort
fields, and data in that field no longer appears sorted.
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
Related Topics
PEDeleteNthSortField
CRPEJob::GetNGroupSortFields
Remarks Returns the number of group sort fields in the specified report. This
method is typically used as one of a series: GetNGroupSortFields
(called once), GetNthGroupSortField (called as many times as
needed to identify the correct group sort field), and
SetNthGroupSortField (called once, when the correct group sort field
is identified). The series can be used to identify and then change an
existing group sort field and/or sort order at print time in response
to a user selection.
Return Value The number of group sort fields in the report. Returns 0 if there are
no group sort fields. Returns -1 if an error occurs.
Class CRPEJob
CRPEJob::SetNthGroupSortField
Parameters sortFieldN
Specifies the number of the group sort field you want to set. The first
group sort field added to the report is field 0, the second is 1, etc. If
the report has N group sort fields, the function can be called with this
parameter between 0 and N-1 to replace an existing group sort field.
Call the function with this parameter equal to N to add a new group
sort field.
field
Specifies the name of the group field to be sorted.
direction
Specifies the sort direction. The following values are possible:
Remarks This method sorts the specified group summary field in the specified
direction (ascending or descending). This method does not create a
new group, but will sort and existing group summary field.
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
Related Topics
PESetNthGroupSortField
Parameters sortFieldN
Specifies the number of the group sort field you want to delete. The
first group sort field added to the report is field 0, the second is 1, etc.
Remarks This method deletes the group sort field at the specified position. The
group and group summary are not removed from the report, but the
field is removed from the list of group sort fields, and the summary
data appearing in the group field is no longer sorted.
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
Related Topics
PEDeleteNthGroupSortField
CRPEJob::GetSQLQuery
Remarks This method retrieves the SQL query that will be sent to the database
server. This method can be used with CRPEJob::SetSQLQuery to
retrieve and then change the SQL query for the report.
Return Values TRUE if the call is successful, FALSE if something goes wrong.
ixString
Assigned the text of the SQL query being sent to the server if the call
completes successfully.
Class CRPEJob
CRPEJob::SetSQLQuery
Parameters query
The text of the new SQL query to be sent to the server.
Remarks This method sets the SQL query that will be sent to the database
server. This method can be used with CRPEJob::GetSQLQuery to
retrieve and then change the SQL query for the report.
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
Related Topics
PESetSQLQuery
CRPEJob::GetReportTitle
Remarks This method gets the report title for the print job.
Return Values TRUE if the call is successful, FALSE if something goes wrong.
ixString
Assigned the title of the report.
Class CRPEJob
CRPEJob::SetReportTitle
Parameter title
Specifies a new title for the report.
Remarks This method sets the report title for the print job. Use this method
whenever you need to change the title of a report at print time.
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
Related Topics
PESetReportTitle
CRPEJob::SetPrintDate
Parameters v_year
Specifies the year of the new print date.
v_month
Specifies the month of the new print date.
v_day
Specifies the day of the new print date.
Remarks This method sets the print date for the report. This method does not
schedule the report to print at a different time or day, but only
Return Values TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
Related Topics
PESetPrintDate
CRPEJob::SetPrintOptions
Parameters options
A pointer to a CRPEPrintOptions class.
Remarks This method may be used to set the print characteristics of a print job.
Use this method any time you want to set the starting page number,
the ending page number, the number of report copies, and/or
collation instructions for a print job at runtime in response to user
specifications.
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
Related Topics
PESetPrintOptions
Parameters nCopies
Specifies the number of copies of the detail section of the report to be
printed.
Remarks This method sets the number of times the Details section of the report
is to be printed. For example, you can use this method to print
multiple copies of labels for a customer, multiple copies of a
purchase order, or multiple copies of anything set up in the Details
section of the report.
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
Related Topics
PESetNDetailCopies
CRPEJob::SetMargins
Parameters left
Specifies the left margin in twips.
right
Specifies the right margin in twips.
top
Specifies the top margin in twips.
bottom
Specifies the bottom margin in twips.
Remarks This method sets the page margins for the print job. Use this method
any time you want to allow the user to change margins.
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
Related Topics
PESetMargins
CRPEJob::SetMinimumSectionHeight
Parameters sectionCode
Specifies the section for which you want to specify the minimum
height. Use one of the following values:
Remarks This method sets the minimum height for the specified section. For
example, use this command whenever you want to specify a
minimum section height for printing onto preprinted forms or
printing on to any other kind of document with a fixed format.
Return Value TRUE if the call is successful, FALSE if you have specified an invalid
section or something goes wrong.
Class CRPEJob
Related Topics
PESetMinimumSectionHeight
CRPEJob::SetLineHeight
Parameters sectionCode
Specifies the section containing the line for which you want to
specify the height. Use one of the following values:
Remarks This method sets the line height for the specified section. This
method can be used for setting up a report to print on preprinted
forms. It can also be used if you want to insure the size of a line with
relation to the font size, for example, to specify a 12 point line with
10 point type.
Return Value TRUE if the call is successful, FALSE if you have specified an invalid
section or something goes wrong.
Class CRPEJob
Related Topics
PESetLineHeight
CRPEJob::SetFont
Parameters sectionCode
Specifies the section of the report for which you want to set the font.
scopeCode
Specifies whether the font selected is to apply to fields, to text, or to
both. To specify both, use the bitwise Or operator: |.
The following values are possible:
faceName
Specifies the actual face name of the font you want to use. The face
name you pass can typically come from a font dialog box, be hard
coded in the application, or be chosen by the application from the
fonts supported on the printer. Example: "Times New Roman".
fontFamily
Specifies the font family for the font you want to use. Use one of the
following values:
charSet
Specifies the character set you wish to use. Use one of the following
values:
ANSI_CHARSET DEFAULT_CHARSET
SYMBOL_CHARSET SHIFTJIS_CHARSET
HANGEFUL_CHARSET CHINESEBIG5_CHARSET
OEM_CHARSET
pointSize
Specifies the desired point size for the selected font. Use 0 to indicate
no change.
isItalic
Specifies whether the font selected should be italicized. Use 1 for
italics, 0 for no italics, or PEP_UNCHANGED to leave the italics as
set up in the report.
isUnderlined
Specifies whether the font should be underlined. Use 1 to underline,
0 for no underline, or PEP_UNCHANGED to leave underline
settings as specified in the report.
isStruckOut
Specifies whether or not the font should appear struck-out. Use 1 for
strike-out, 0 for no strike out, or PEP_UNCHANGE to leave strike-
out settings as specified in the report.
FW_DONTCARE FW_THIN
FW_EXTRALIGHT FW_LIGHT
FW_NORMAL FW_MEDIUM
FW_SEMIBOLD FW_BOLD
FW_EXTRABOLD FW_HEAVY
FW_ULTRALIGHT FW_REGULAR
FW_DEMIBOLD FW_ULTRABOLD
FW_BLACK
Remarks This method sets the font and font characteristics for the specified
section. Use any time you need to change a default font at runtime in
response to user input, or to specify a built-in printer font.
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
Related Topics
PESetFont
CRPEJob::OutputToWindow
Parameters title
Specifies the title you want to appear in the title bar.
left
Specifies the x coordinate of the upper left hand corner of the
Preview Window , in device coordinates.
top
Specifies the y coordinate of the upper left hand corner of the
Preview Window , in device coordinates.
Remarks This method sets the output of the print job to the Preview Window
which will have the specified attributes. This method does not print
the report, but specifies that when the report is printed, it will appear
in a Preview Window . To actually print the report, use
CRPEJob::Start.
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
Related Topics
PEOutputToWindow
CRPEJob::OutputToPrinter
Parameters nCopies
Specifies how many copies of the report are to be printed. Default is
1 copy.
Remarks This method sets the output of the print job to the printer with the
specified number of copies. This method does not print the report,
but specifies that when the report is printed, it will be sent to a
printer. To actually print the report, use CRPEJob::Start.
Class CRPEJob
Related Topics
PEOutputToPrinter
CRPEJob::SelectPrinter
Parameters driverName
Specifies the name of the printer driver for the printer being selected.
printerName
Specifies the name of the printer being selected (as indicated in the
Printers Control Panel).
PortName
Specifies the name of the port the printer is attached to. For example:
"LPT1:".
mode
A pointer to a DEVMODE class. The default implementation of
CRPEJob::SelectPrinter ignores this parameter. For more
information on the DEVMODE class, refer to the Microsoft Windows
SDK.
Remarks This method specifies the printer and/or print characteristics for the
print job. You can use this method to enable the user to select a
printer other than the default printer at print time. One way of doing
this is to have your application call the Windows common Print
Setup dialog box.
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
CRPEJob::ExportTo
Parameters options
A pointer to a CRPEExportOptions class.
Remarks This method sets the output of the print job to be exported. The
export format is specified through the options parameter. This
method does not export the report, but specifies that when the report
is printed, it will be exported to a disk file or E-mail address
according to settings in the options parameter. To actually export the
report, use CRPEJob::Start.
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
Related Topics
PEExportTo
CRPEJob::GetExportOptions
Remarks This method prompts the user with a series of dialogs to specify the
export options to be used. These options are used by the Class
Library to fill in a CRPEExportOptions class. The
CRPEJob::ExportTo function can then be used to set the print job
destination using the information in th this class.
Class CRPEJob
Related Topics
PEGetExportOptions
CRPEJob::GetErrorCode
Remarks This method gets the error code for the print job. When a call to
another function fails, this call gets the error code that was generated
so you can take some action based on that error code.
Class CRPEJob
Related Topics
PEGetErrorCode
CRPEJob::GetErrorText
Remarks This method returns a descriptive error message for the print job.
Class CRPEJob
CRPEJob::PrintControlsShowing
Remarks Checks if the print controls are displayed in the Preview Window .
Use CRPEJob::ShowPrintControls to change whether or not print
controls will appear in the Preview Window .
Class CRPEJob
Related Topics
PEPrintControlsShowing
CRPEJob::GetNFormulas
Remarks Use this function to fetch the number of formulas in the report. To
fetch the formula by number, use CRPEJob::GetNthFormula.
Return Value The number of formulas in the report. If no formulas exist in the
report, 0 is returned. If an error occurs, -1 is returned.
Class CRPEJob
CRPEJob::GetNthFormula
Parameter formulaN
Specifies the number of the formula about which you want to gather
information. The first formula added to your report is 0, the second
is 1, etc.
Remarks Use this function to obtain the formula name and formula text of a
specific formula in the report. Once the formula name is obtained,
formula text can be changed with CRPEJob::SetFormula.
Class CRPEJob
Related Topics
PEGetNthFormula
CRPEJob::CheckFormula
Parameters formulaName
The name of the formula that you need to check for errors.
Return Value TRUE if the formula text is okay, FALSE if there is an error in the
formula or something goes wrong.
Class CRPEJob
Related Topics
PECheckFormula
CRPEJob::CheckSelectionFormula
Remarks Use this method to check the record selection formula for the report
for errors. This method works just like the Check button in the
Formula Editor. If the selection formula contains an error, the
method returns FALSE.
Return Value TRUE if the formula text is okay, FALSE if there is an error in the
formula or something goes wrong.
Class CRPEJob
Related Topics
PECheckSelectionFormula
CRPEJob::CheckGroupSelectionFormula
Remarks Use this method to check the group selection formula for the report
for errors. This method works just like the Check button in the
Formula Editor. If the group selection formula contains an error, the
method returns FALSE.
Class CRPEJob
Related Topics
PECheckGroupSelectionFormula
CRPEJob::GetNGroups
Remarks Use this method to fetch the number of group sections in the report.
Return Values The number of group sections in the report. Returns -1 if an error
occurs.
Class CRPEJob
Related Topics
PEGetNGroups
CRPEJob::GetGroupCondition
Parameter sectionCode
Specifies the code for the report section for which you want to get the
grouping condition. Possible values are:
For group condition field types other than Date and Boolean, the
group condition value of the condition parameter is
PEP_GC_ANYCHANGE. For a group condition field of the type
Date, the group condition value will be one of the following:
SMALLINT
Obtains the sort direction for the group summary field. Possible
values are:
Class CRPEJob
Related Topics
PEGetGroupCondition
CRPEJob::GetNParams
Remarks Use this method whenever you need to know how many parameters
are required by a stored procedure in a SQL database table. This
method is usually used in conjunction with CRPEJob::GetNthParam
or CRPEJob::SetNthParam.
Return Value The number of parameters in the current stored procedure being
used to generate the report.
Class CRPEJob
CRPEJob::GetNthParam
Parameter paramN
Specifies which parameter in the stored procedure you want to get
the value of. The first parameter of a stored procedure is 0, the
second is 1, etc.
Remarks Gets the Nth parameter of a stored procedure. Use this method
whenever you need to find out a particular parameter required by a
stored procedure in a SQL database table.
Class CRPEJob
Related Topics
PEGetNthParam
CRPEJob::SetNthParam
Parameters paramN
Specifies which parameter in the stored procedure you want to set
the value of. The first parameter of a stored procedure is 0, the
second is 1, etc.
Remarks Sets the value of a parameter in a stored procedure. Use this method
when working with stored procedures in SQL database tables to set
the value of a parameter in a stored procedure. When passing
parameter values, All parameter values must be passed as string
values. If you wish to pass a numeric value, pass the value in quotes
like this: "100".
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
Related Topics
PESetNthParam
CRPEJob::GetPrintDate
Remarks Determines the print date (if any) that was specified with the report.
Use this method to fetch the print date and pass back using
CRPEJob::SetPrintDate.
Related Topics
PEGetPrintDate
CRPEJob::GetPrintOptions
Remarks Retrieves the print options specified for the report (the options that
are set in the Print Setup common dialog box) and uses them to fill in
the CRPEPrintOptions class. Use this function to fetch print options
from the report in order to update them and pass back using
CRPEJob::SetPrintOptions.
Class CRPEJob
Related Topics
PEGetPrintOptions
CRPEJob::GetNDetailCopies
Remarks Returns the number of copies of each Details section in the report
that are to be printed. Use this method to find out how many times
each Details section of the report will be printed. To change the
number of times each Details section is printed, use
CRPEJob::SetNDetailCopies.
Class CRPEJob
Related Topics
PEGetNDetailCopies
CRPEJob::GetMargins
Remarks Retrieves the page margin settings for the specified report. Use this
method to find out what the currently set margins for the report are.
Use CRPEJob::SetMargins to change report margins.
Class CRPEJob
Related Topics
PEGetMargins
Parameters sectionCode
Specifies the code for the report section for which you want to
retrieve the minimum height. Possible values are:
Related Topics
PEGetMinimumSectionHeight
CRPEJob::GetLineHeight
Parameters sectionCode
Specifies the code for the report section containing the line you want
to retrieve the height of. Possible values are:
lineN
Specifies the line number within the specified section for which you
want to retrieve the height of. The first line in a section is line 0, the
second is 1, etc. Use PEP_ALLLINES to retrieve information on all
lines in a section.
Remarks Gets line height and ascent information for a specified line in a
selected section of the report. You can change and pass back a new
line height and ascent using CRPEJob::SetLineHeight.
Class CRPEJob
CRPEJob::GetNLinesInSection
Parameters sectionCode
Specifies the code for the report section that you need to know the
number of lines for. Possible values are:
Remarks Use this method to find out how long a specified report section is
according to the number of lines in the section. This is useful when
trying to fit mailing label reports into the labels you are using, for
example.
Class CRPEJob
CRPEJob::GetSelectedPrinter
Class CRPEJob
CRPEJob::GetSectionFormat
Parameter sectionCode
Specifies the code for the report section that you need to obtain
format information for. Possible values are:
Remarks Retrieves the section format settings for a selected section in the
specified report and supplies the information by assigning values to
the members of the CRPESectionOptions class. Use this method in
order to edit and update the section formats and pass information
back using CRPEJob::SetSectionFormat.
Class CRPEJob
Related Topics
PEGetSectionFormat
CRPEJob::SetSectionFormat
Parameters sectionCode
Specifies the code for the report section that you need to change
format information for. Possible values are:
options
A pointer to a CRPESectionOptions class.
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
Related Topics
PESetSectionFormat
CRPEJob::GetGraphType
Parameters sectionCode
Specifies the section of the report containing the graph you want to
find out the type of. Possible values are:
Remarks Identifies one of the available graph/chart types used for the
specified graph in the specified section. Use this method to find out
what type of graph is being displayed in the report. There are many
types of graphs and charts possible with Crystal Reports. This
method will return the type of graph or chart being displayed.
Related Topics
PEGetGraphType
CRPEJob::SetGraphType
Parameters sectionCode
Specifies the section of the report containing the graph you want to
change the type of. Possible values are:
graphN
Specifies which graph within the section you want to change the type
of. This value is 0 indexed. Within a section, graphs are numbered
from top to bottom, first, then from left to right if they have the same
top.
graphType
Specifies the style of the graph you want to set.
Remarks Changes the type of graph displayed for the specified graph in the
specified section based on one of the available graph/chart types.
Use this method to change the type of graph that is displayed in a
report.
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
Related Topics
PESetGraphType
Parameters sectionCode
Specifies the section of the report containing the graph you want to
get information from. Possible values are:
graphN
Specifies which graph within the section you want to get graph data
information from. This value is 0 indexed. Within a section, graphs
are numbered from top to bottom, first, then from left to right if they
have the same top.
Remarks Use this method to find out what data in your report is being used by
a specified graph when the graph is created. This information
includes which groups are used to create the rows and columns of
the graph and which summary field in the report is used to set the
values of the risers in the graph.
Class CRPEJob
Related Topics
PEGetGraphData
CRPEJob::SetGraphData
Parameters sectionCode
Specifies the section of the report containing the graph you want to
change graph data information for. Possible values are:
graphN
Specifies which graph within the section you want to change graph
data information for. This value is 0 indexed. Within a section,
graphs are numbered from top to bottom, first, then from left to right
if they have the same top.
graphDataInfo
A pointer to a CRPEGraphDataInfo class.
Class CRPEJob
Related Topics
PESetGraphData
CRPEJob::GetGraphText
Parameters sectionCode
Specifies the section of the report containing the graph you want to
get title text for. Possible values are:
graphN
Specifies which graph within the section you want to get title text for.
This value is 0 indexed. Within a section, graphs are numbered from
top to bottom, first, then from left to right if they have the same top.
Class CRPEJob
Related Topics
PEGetGraphText
CRPEJob::SetGraphText
Parameters sectionCode
Specifies the section of the report containing the graph you want to
change the text of. Possible values are:
Remarks This method allows you to set or change the text that appears with a
graph. A graph can have a title, subtitle, footnote, title for groups,
title for series, title for the X axis, title for the Y axis, and title for the
Z axis (in 3D graphs).
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
Related Topics
PESetGraphText
CRPEJob::GetGraphOptions
Parameters sectionCode
Specifies the section of the report containing the graph you want to
get graph display options for. Possible values are:
Remarks Use this method to obtain information about any of several graph
options. These options include the minimum and maximum values
that can appear on the graph, whether grid lines appear, whether
risers are labeled, whether bar graphs have horizontal or vertical
bars, and whether a legend appears on the graph.
Class CRPEJob
Related Topics
PEGetGraphOptions
CRPEJob::SetGraphOptions
Parameters sectionCode
Specifies the section of the report containing the graph you want to
change display options for. Possible values are:
graphN
Specifies which graph within the section you want to change display
options for. This value is 0 indexed. Within a section, graphs are
numbered from top to bottom, first, then from left to right if they
have the same top.
graphOptions
A pointer to a CRPEGraphOptions class.
Remarks Use this function to change any of several graph options. These
options include the minimum and maximum values that can appear
on the graph, whether grid lines appear, whether risers are labeled,
whether bar graphs have horizontal or vertical bars, and whether a
legend appears on the graph.
Return Value TRUE if the call is successful, FALSE if something goes wrong.
Class CRPEJob
Related Topics
PESetGraphOptions
Parameter sortFieldN
Specifies the number of the group sort field you want to retrieve. The
first group sort field is field 0. If the report has N sort fields, the
function can be called with sortFieldN between 0 and N-1.
Remarks Returns information about one of the group sort fields in the
specified report: that is, it returns the name of the field and the
direction (ascending or descending) of the sort. This method is
typically used as one of a series: CRPEJob::GetNGroupSortFields
(called once), CRPEJob::GetNthGroupSortField (called as many
times as needed to identify the correct group sort field), and
CRPEJob::SetNthGroupSortField (called once when the correct sort
field is identified). The series can be used to identify and then change
an existing group sort field and/or sort order at print time in
response to a user selection.
Class CRPEJob
Related Topics
PEGetNthGroupSortField
In this example, you know which section you want to format, you
just need the program to create the section code so you can pass it. To
format the second section in the Group Header 1 area, you use code
similar to this:
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, you use the zero
indexed group number 0) and section number (since this is the
second section in the group header, you use the zero indexed section
number 1). The program uses the encoding macro and returns 3025
as the section code which is then passed in the PESetSectionFormat
call.
Decoding
In this example, you retrieve the section codes of each section and
decode them to identify the section of interest, and then you format
that section. You determine the number of sections (using
PEGetNSections), return 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.
Your code would look similar to this:
numSections = PEGetNSections(job);
code = PEGetSectionCode(job, loopSectionN)
areaType = PE_SECTION_TYPE(code)
groupN = PE_GROUP_N(code)
sectionN = PE_SECTION_N(code)
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: The macros enable you to have individual control over as
many as 25 Groups and 40 sections per area.
Section Map
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)
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)
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)
FUNCTIONS
PECancelPrintJob
Parameters printJob
Specifies the handle to the print job.
PECancelPrintJob 16-bit
(VB Syntax) Declare Sub PECancelPrintJob Lib "crpe.dll"
(ByVal printJob As Integer)
32-bit
Declare Sub PECancelPrintJob Lib "crpe32.dll"
(ByVal printJob As Integer)
PECancelPrintJob 16-bit
(Delphi Syntax) procedure PECancelPrintJob (
printJob: integer
);
32-bit
procedure PECancelPrintJob (
printJob: Word
)stdcall;
Return Value True if the Engine can be closed, False if the Engine is busy.
PECanCloseEngine 16-bit
(VB Syntax) Declare Function PECanCloseEngine Lib
"crpe.dll" () As Integer
32-bit
Declare Function PECanCloseEngine Lib
"crpe32.dll" () As Integer
PECanCloseEngine 16-bit
(Delphi Syntax) function PECanCloseEngine: Bool;
32-bit
function PECanCloseEngine: Bool stdcall;
Parameters printJob
The handle of the print job containing the named formula you are
checking.
formulaName
The name of the formula you wish to check for errors.
Return Value TRUE (1) if the formula is correct, FALSE (0) if the formula has an
error.
Remarks ● When specifying the name of the formula, do not use the @
symbol before the name. The @ symbol is only used by Crystal
Reports to separate a formula field from other types of fields.
● PECheckFormula works like the Check button that appears in the
Crystal Reports Formula Editor.
PECheckFormula 16-bit
(VB Syntax) Declare Function PECheckFormula Lib "crpe.dll"
(ByVal printJob As Integer, ByVal FormulaName
As String) As Integer
PECheckFormula 16-bit
(Delphi Syntax) function PECheckFormula (
printJob: integer;
formulaName: PChar
): Bool;
32-bit
function PECheckFormula (
printJob: Word;
formulaName: PChar
): Bool stdcall;
PECheckGroupSelectionFormula
Parameters printJob
The handle of the print job for the report containing the group
selection formula you wish to check.
Return Value TRUE (1) if there are no errors in the group selection formula, FALSE
(0) if the group selection formula contains an error.
PECheckGroup 16-bit
SelectionFormula Declare Function PECheckGroupSelectionFormula
Lib "crpe.dll" (ByVal printJob As Integer) As
(VB Syntax) Integer
32-bit
Declare Function PECheckGroupSelectionFormula
Lib "crpe32.dll" (ByVal printJob As Integer) As
Integer
PECheckGroup 16-bit
SelectionFormula function PECheckGroupSelectionFormula (
printJob: integer
(Delphi Syntax) ): Bool;
32-bit
function PECheckGroupSelectionFormula (
printJob: Word
): Bool stdcall;
PECheckSelectionFormula
Checks the text of the report's record selection formula for errors.
Use this function whenever the record selection formula has been
changed and you wish to check the formula for syntax errors. If the
record selection formula contains an error, this function returns a
False value.
Parameters printJob
The handle of the print job containing the record selection formula
that you are checking.
Return Value TRUE (1) if the selection formula does not have an error, FALSE (0)
if the selection formula contains an error.
PECheckSelection 16-bit
Formula Declare Function PECheckSelectionFormula Lib
"crpe.dll" (ByVal printJob As Integer) As
(VB Syntax) Integer
32-bit
Declare Function PECheckSelectionFormula Lib
"crpe32.dll" (ByVal printJob As Integer) As
Integer
PECheckSelection 16-bit
Formula function PECheckSelectionFormula (
printJob: integer
(Delphi Syntax) ): Bool;
32-bit
function PECheckSelectionFormula (
printJob: Word
): Bool stdcall;
PECloseEngine
Remarks Once this function has been called, no other Report Engine functions
can be called except PEOpenEngine.
PECloseEngine 16-bit
(VB Syntax) Declare Sub PECloseEngine Lib "crpe.dll" ()
32-bit
Declare Sub PECloseEngine Lib "crpe32.dll" ()
32-bit
procedure PECloseEngine stdcall;
PEClosePrintJob
PEClosePrintJob closes the print job. If printing has not yet finished,
it continues; if the print window is open, it stays open. This function
is used as a mandatory part of each custom-print link to shut down
the print job once it has finished printing to screen or to window.
BOOL CRPE_API PEClosePrintJob (
short printJob//handle to print job
);
Parameters printJob
Specifies the handle of the print job you want to close.
Return Value TRUE (1) if the call is successful, FALSE (0) if the call fails.
Remarks Once this function has been called, most other Report Engine
functions, except PEOpenPrintJob, PECloseEngine, PEGetVersion
and PELogOnServer can not be called.
PEClosePrintJob 16-bit
(VB Syntax) Declare Sub PEClosePrintJob Lib "crpe.dll"
(ByVal printJob As Integer)
PEClosePrintJob 16-bit
(Delphi Syntax) function PEClosePrintJob (
printJob: integer
): Bool;
32-bit
function PEClosePrintJob (
printJob: word
): Bool stdcall;
PECloseSubreport
Parameters printJob
Specifies the handle to the subreport you want to close.
Return Value TRUE (1) if the call is successful, FALSE (0) if the call fails.
Remarks Once this function has been called, PEGetSubreportInfo or any other
Report Engine function that applies to the subreport can not be
called.
PECloseSubreport 16-bit
(VB Syntax) Declare Function PECloseSubreport Lib
"crpe.dll" (ByVal printJob As Integer) As
Integer
32-bit
Declare Function PECloseSubreport Lib
"crpe32.dll" (ByVal printJob As Integer) As
Integer
PECloseSubreport 16-bit
(Delphi Syntax) function PECloseSubreport (
printJob: integer
): Bool;
32-bit
function PECloseSubreport (
printJob: Word
): Bool stdcall;
PECloseWindow
Parameters printJob
Specifies the handle to the print job for which you want to close the
print window.
PECloseWindow 16-bit
(VB Syntax) Declare Sub PECloseWindow Lib "crpe.dll" (ByVal
printJob As Integer)
32-bit
Declare Sub PECloseWindow Lib "crpe32.dll"
(ByVal printJob As Integer)
PECloseWindow 16-bit
(Delphi Syntax) procedure PECloseWindow (
printJob: integer
);
32-bit
procedure PECloseWindow (
printJob: Word
)stdcall;
Parameters printJob
Specifies the handle of the print job from which you want to delete a
group sort field.
sortFieldN
Specifies the number of the sort field you want to delete. The first
group sort field is field 0. If N = 0, the function will delete the first
group sort field. If the report has N group sort fields, the function can
be called with sortFieldN between 0 and N-1.
Return Value TRUE (1) if the call is successful, FALSE (0) if the call fails.
PEDeleteNth 16-bit
GroupSortField Declare Function PEDeleteNthGroupSortField Lib
"crpe.dll" (ByVal printJob As Integer, ByVal
(VB Syntax) SortFieldN As Integer) As Integer
32-bit
Declare Function PEDeleteNthGroupSortField Lib
"crpe32.dll" (ByVal printJob As Integer, ByVal
SortFieldN As Integer) As Integer
PEDeleteNth 16-bit
GroupSortField function PEDeleteNthGroupSortField (
printJob: integer;
(Delphi Syntax) sortFieldN: integer
): Bool;
32-bit
function PEDeleteNthGroupSortField (
printJob: Word;
sortFieldN: integer
): Bool stdcall;
PEDeleteNthSortField
Parameters printJob
Specifies the handle of the print job from which you want to delete a
sort field.
sortFieldN
Specifies the number of the sort fields you want to delete. The first
sort field is field 0. If N = 0, the function will delete the first sort field,
If the report has N sort fields, you can call the function with
sortFieldN between 0 and N-1.
Return Value TRUE (1) if the call is successful, FALSE (0) if the call fails.
PEDeleteNthSort 16-bit
Field (VB Syntax) Declare Function PEDeleteNthSortField Lib
"crpe.dll" (ByVal printJob As Integer, ByVal
SortFieldN As Integer) As Integer
32-bit
Declare Function PEDeleteNthSortField Lib
"crpe32.dll" (ByVal printJob As Integer, ByVal
SortFieldN As Integer) As Integer
32-bit
function PEDeleteNthSortField (
printJob: Word;
sortFieldN: integer
): Bool stdcall;
PEDiscardSavedData
Parameters printJob
Specifies the handle to the print job for which you want to discard
saved data.
Return Value TRUE (1) if the call is successful, FALSE (0) if the call fails.
PEDiscardSaved 16-bit
Data (VB Syntax) Declare Function PEDiscardSavedData Lib
"crpe.dll" (ByVal printJob As Integer) As
Integer
32-bit
Declare Function PEDiscardSavedData Lib
"crpe32.dll" (ByVal printJob As Integer) As
Integer
PEDiscardSaved 16-bit
Data function PEDiscardSavedData (
printJob: integer
(Delphi Syntax) ): Bool;
32-bit
function PEDiscardSavedData (
printJob: Word
): Bool stdcall;
PEEnableProgressDialog
Return Value TRUE (1) if the call is successful, FALSE (0) if the call fails.
PEEnableProgress 16-bit
Dialog (VB Syntax) Declare Function PEEnableProgressDialog Lib
"crpe.dll" (ByVal printJob As Integer, ByVal
enable As Integer) As Integer
32-bit
Declare Function PEEnableProgressDialog Lib
"crpe32.dll" (ByVal printJob As Integer, ByVal
enable As Integer) As Integer
PEEnableProgress 16-bit
Dialog function PEEnableProgressDialog (
printJob: integer;
(Delphi Syntax) enable: Bool
): Bool;
32-bit
function PEEnableProgressDialog (
printJob: word;
enable: Bool
): Bool stdcall;
Parameters printJob
Specifies the handle to the print job you want to print to a window.
toMail
Indicates whether or not the function is to export to E-mail.
waitUntilDone
Indicates whether or not the function is to return as soon as printing
starts. Use one of the following values:
Value Meaning
TRUE The function returns when printing is
finished. In version 1.1 and higher of
CRPE, "waitUntilDone" must be true.
FALSE The function returns as soon as printing
starts.
Return Value TRUE (1) if the call is successful, FALSE (0) if the call fails.
PEExportPrint 16-bit
Window Declare Function PEExportPrintWindow Lib
"crpe.dll" (ByVal printJob As Integer, ByVal
(VB Syntax) ToMail As Integer, ByVal WaitUntilDone As
Integer) As Integer
32-bit
Declare Function PEExportPrintWindow Lib
"crpe32.dll" (ByVal printJob As Integer, ByVal
ToMail As Integer, ByVal WaitUntilDone As
Integer) As Integer
PEExportPrint 16-bit
Window function PEExportPrintWindow(
printJob: integer;
(Delphi Syntax) toMail: Bool;
waitUntilDone: Bool
): Bool;
32-bit
function PEExportPrintWindow (
printJob: Word;
toMail: Bool;
waitUntilDone: Bool
): Bool stdcall;
Exports a print job using the name, format, and destination specified
in the PEExportOptions structure (see Page 662). Use this function
any time you want to print a report to a file or export it for use in
other programs.
BOOL CRPE_API PEExportTo (
short printJob, //handle to print job
struct PEExportOptions Far *options
//pointer to structure
);
Parameters printJob
Specifies the handle of the print job that you want to export.
options
Specifies the pointer to the PEExportOptions structure.
Return Value TRUE (1) if the call is successful, FALSE (0) if the call fails.
PEExportTo 16-bit
(VB Syntax) Declare Function PEExportTo Lib "crpe.dll"
(ByVal printJob As Integer, ExportOptions As
PEExportOptions) As Integer
32-bit
Declare Function PEExportTo Lib "crpe32.dll"
(ByVal printJob As Integer, ExportOptions As
PEExportOptions) As Integer
PEExportTo 16-bit
(Delphi Syntax) function PEExportTo (
printJob: integer;
var options: PEExportOptions
): Bool;
PEGetErrorCode
Returns a number that indicates the status of the most recent Report
Engine function called. When a call to another function fails, this call
gets the error code that was generated so you can take some action
based on that error code.
short CRPE_API PEGetErrorCode (
short printJob//handle to print job
);
Parameters printJob
Specifies the handle of the print job from which you want to gather
an error code.
Return Value Returns 0 if the function completed without error; returns the code
number of the most recent error for the given job if the function was
unsuccessful.
PEGetErrorCode 16-bit
(VB Syntax) Declare Function PEGetErrorCode Lib "crpe.dll"
(ByVal printJob As Integer) As Integer
32-bit
Declare Function PEGetErrorCode Lib
"crpe32.dll" (ByVal printJob As Integer) As
Integer
32-bit
function PEGetErrorCode (
printJob: Word
): smallint stdcall;
Remarks If the most recent function was called while no print job was open
(e.g., PEOpenEngine), use 0 for 'printJob'. PEGetErrorCode must be
called immediately after the call to the function which indicated an
error.
PEGetErrorText
Parameters printJob
Specifies the handle of the print job from which you want to retrieve
an error string.
textHandle
Specifies the pointer to the handle of the string containing the error text.
Return Value TRUE (1) if the call is successful, FALSE (0) if the call fails.
Remarks If the most recent function was called while no print job was open,
use 0 for 'printJob'.
PEGetErrorText 16-bit
(VB Syntax) Declare Function PEGetErrorText Lib "crpe.dll"
(ByVal printJob As Integer, TextHandle As
Integer, TextLength As Integer) As Integer
32-bit
Declare Function PEGetErrorText Lib
"crpe32.dll" (ByVal printJob As Integer,
TextHandle As Long, TextLength As Integer) As
Integer
PEGetErrorText 16-bit
(Delphi Syntax) function PEGetErrorText (
printJob: integer;
var textHandle: HWnd;
var textLength: integer
): Bool;
32-bit
function PEGetErrorText (
printJob: Word;
var textHandle: HWnd;
var textLength: Word
): Bool stdcall;
Gets export options from the user before exporting the report.
PEGetExportOptions can be used to present a series of dialog boxes
that retrieve export options from your users. These options are used
by the Report Engine to fill in the PEExportOptions structure. The
PEExportTo function can then be used to set the print job destination
using the information in the PEExportOptions structure (see Page
662).
BOOL CRPE_API PEGetExportOptions (
short printJob, //handle to print job
struct PEEXportOptionsFAR *options
//pointer to structure
);
Parameters printJob
Specifies the print job from which you want to get export options.
options
Specifies the pointer to the PEExportOptions structure.
Return Value TRUE (1) if the call is successful, FALSE (0) if the call fails.
PEGetExport 16-bit
Options Declare Function PEGetExportOptions Lib
"crpe.dll" (ByVal printJob As Integer,
(VB Syntax) ExportOptions As PEExportOptions) As Integer
32-bit
Declare Function PEGetExportOptions Lib
"crpe32.dll" (ByVal printJob As Integer,
ExportOptions As PEExportOptions) As Integer
32-bit
function PEGetExportOptions (
printJob: Word;
var options: PEExportOptions
): Bool stdcall;
PEGetFormula
Parameters printJob
Specifies the handle of the print job from which you want to retrieve
the formula string.
formulaName
Specifies a pointer to the null-terminated string that contains the
name of the formula for which you want to retrieve the formula
string.
textHandle
Specifies the pointer to the handle of the string containing the
formula text.
Return Value TRUE (1) if the call is successful, FALSE (0) if the named formula
does not exist in the report.
PEGetFormula 16-bit
(VB Syntax) Declare Function PEGetFormula Lib "crpe.dll"
(ByVal printJob As Integer, ByVal FormulaName
As String, TextHandle As Integer, TextLength As
Integer) As Integer
32-bit
Declare Function PEGetFormula Lib "crpe32.dll"
(ByVal printJob As Integer, ByVal FormulaName
As String, TextHandle As Long, TextLength As
Integer) As Integer
PEGetFormula 16-bit
(Delphi Syntax) function PEGetFormula (
printJob: integer;
formulaName: PChar;
var textHandle: HWnd;
var textLength: integer
): Bool;
32-bit
function PEGetFormula (
printJob: Word;
formulaName: PChar;
var textHandle: HWnd;
var textLength: Word
): Bool stdcall;
Parameters printJob
Specifies the handle of the print job from which you want to get
information about a graph.
sectionCode
Specifies the code for the report section in which the graph appears.
See the table of section constants supplied with PESetSectionFormat.
graphN
Specifies which graph within the section you want data for. This
value is 0 indexed. Within a section, graphs are numbered from top
to bottom, first, then from left to right if they have the same top.
graphDataInfo
Specifies the pointer to the PEGraphDataInfo structure (see Page
668).
Return Value TRUE (1) if the call is successful, FALSE (0) if the call fails.
PEGetGraphData 16-bit
(VB Syntax) Declare Function PEGetGraphData Lib "crpe.dll"
(ByVal printJob As Integer, ByVal sectionCode
As Integer, ByVal GraphN As Integer,
GraphDataInfo As PEGraphDataInfo) As Integer
32-bit
Declare Function PEGetGraphData Lib
"crpe32.dll" (ByVal printJob As Integer, ByVal
sectionCode As Integer, ByVal GraphN As
Integer, GraphDataInfo As PEGraphDataInfo) As
Integer
PEGetGraphData 16-bit
(Delphi Syntax) function PEGetGraphData (
printJob: integer;
sectionCode: integer;
graphN: integer;
var graphDataInfo:
): Bool;
32-bit
function PEGetGraphData (
printJob: Word;
sectionCode: integer;
graphN: integer;
var graphDataInfo:
): Bool stdcall;
PEGetGraphOptions
Identifies the display options that are set for the specified graph in
the specified section. Use this function to obtain information about
any of several graph options. These options include the minimum
and maximum values that can appear on the graph, whether grid
lines appear, whether risers are labeled, whether bar graphs have
horizontal or vertical bars, and whether a legend appears on the
graph.
Parameters printJob
Specifies the handle of the print job from which you want to get
information about a graph.
sectionCode
Specifies the code for the report section in which the graph appears.
See the table of section constants supplied with PESetSectionFormat.
graphN
Specifies which graph within the section you want information
about. This value is 0 indexed. Within a section, graphs are
numbered from top to bottom, first, then from left to right if they
have the same top.
graphOptions
Specifies the pointer to the PEGraphOptions structure.
Return Value TRUE (1) if the call is successful, FALSE (0) if the call fails.
PEGetGraph 16-bit
Options Declare Function PEGetGraphOptions Lib
"crpe.dll" (ByVal printJob As Integer, ByVal
(VB Syntax) sectionCode As Integer, ByVal GraphN As
Integer, GraphOptions As PEGraphOptions) As
Integer
PEGetGraph 16-bit
Options function PEGetGraphOptions (
printJob: integer;
(Delphi Syntax) sectionCode: integer;
graphN: integer;
var graphOptions: PEGraphOptions
): Bool;
32-bit
function PEGetGraphOptions (
printJob: Word;
sectionCode: integer;
graphN: integer;
var graphOptions: PEGraphOptions
): Bool stdcall;
PEGetGraphText
Gets the identifying text that appears on the specified graph in the
specified section. This function allows you to find out what text
appears with a graph. A graph can have a title, subtitle, footnote, title
for groups, title for series, title for the X axis, title for the Y axis, and
title for the Z axis (in 3D graphs).
BOOL CRPE_API PEGetGraphText (
short printJob, //handle to print job
short sectionCode,
// code identifying graph section
short graphN, //number of graph in section
struct PEGraphTextInfo FAR *graphTextInfo
//structure pointer
);
Parameters printJob
Specifies the handle of the print job from which you want to get the
text displayed with a graph.
Return Value TRUE (1) if the call is successful, FALSE (0) if the call fails.
PEGetGraphText 16-bit
(VB Syntax) Declare Function PEGetGraphText Lib "crpe.dll"
(ByVal printJob As Integer, ByVal sectionCode
As Integer, ByVal GraphN As Integer,
GraphTextInfo As PEGraphTextInfo) As Integer
32-bit
Declare Function PEGetGraphText Lib
"crpe32.dll" (ByVal printJob As Integer, ByVal
sectionCode As Integer, ByVal GraphN As
Integer, GraphTextInfo As PEGraphTextInfo) As
Integer
PEGetGraphText 16-bit
(Delphi Syntax) function PEGetGraphText (
printJob: integer;
sectionCode: integer;
graphN: integer;
var graphTextInfo: PEGraphTextInfo
): Bool;
PEGetGraphType
Parameters printJob
Specifies the handle of the print job from which you want to find out
the type of graph being displayed.
sectionCode
Specifies the code for the report section in which the graph appears.
See the table of section constants supplied with PESetSectionFormat.
graphN
Specifies which graph within the section you want to know the type
of. This value is 0 indexed. Within a section, graphs are numbered
from top to bottom, first, then from left to right if they have the same
top.
graphType
Returns a pointer to the type of graph being displayed.
Return Value TRUE (1) if the call is successful, FALSE (0) if the call fails.
PEGetGraphType 16-bit
(VB Syntax) Declare Function PEGetGraphType Lib "crpe.dll"
(ByVal printJob As Integer, ByVal sectionCode
As Integer, ByVal GraphN As Integer, GraphType
As Integer) As Integer
PEGetGraphType 16-bit
(Delphi Syntax) function PEGetGraphType (
printJob: integer;
sectionCode: integer;
graphN: integer;
var graphType: integer
):Bool;
32-bit
function PEGetGraphType (
printJob: Word;
sectionCode: integer;
graphN: integer;
var graphType: integer
): Bool stdcall;
PEGetGroupCondition
Return Value TRUE (1) if the call is successful, FALSE (0) if the call fails.
Remarks The condition parameter returns a value that encodes both the
condition and the type of the condition field. You need to apply a
condition mask (PE_GC_CONDITIONMASK) or a type mask
(PE_GC_TYPEMASK) against this value using a bitwise AND to
determine the condition or type respectively. For example:
short result;
if (result == PE_GC_TYPEDATE)
{
//what you want it to do
}
PEGetGroup 16-bit
Condition Declare Function PEGetGroupCondition Lib
"crpe.dll" (ByVal printJob As Integer, ByVal
(VB Syntax) sectionCode As Integer, ConditionFieldHandle As
Integer, ConditionFieldLength As Integer,
Condition As Integer, SortDirection As Integer)
As Integer
32-bit
Declare Function PEGetGroupCondition Lib
"crpe32.dll" (ByVal printJob As Integer, ByVal
sectionCode As Integer, ConditionFieldHandle As
Long, ConditionFieldLength As Integer,
Condition As Integer, SortDirection As Integer)
As Integer
PEGetGroup 16-bit
Condition function PEGetGroupCondition (
printJob: integer;
(Delphi Syntax) sectionCode: integer;
var conditionFieldHandle: HWnd;
var conditionFieldLength: integer;
var condition: integer;
var sortDirection: integer
): Bool;
32-bit
function PEGetGroupCondition (
printJob: Word;
sectionCode: integer;
var conditionFieldHandle: Hwnd;
PEGetGroupSelectionFormula
Returns the string handle for the group selection formula used in the
specified report. This function is typically used as one of a series of
functions (PEGetGroupSelectionFormula, PEGetHandleString,
PESetGroupSelectionFormula). This series can be used in a custom-
print link to identify and then change an existing group selection
formula at print time in response to a user selection.
BOOL CRPE_API PEGetGroupSelectionFormula (
short printJob, //handle to print job
HANDLE FAR *textHandle,
//handle to formula string
short FAR *textLength
//handle to formula string length
);
Parameters printJob
Specifies the handle of the print job for which you want to retrieve
the group selection formula string.
textHandle
Specifies the pointer to the handle of the string containing the
formula text.
textLength
Specifies the pointer to the length of the formula string (in bytes)
including the terminating byte.
Return Value TRUE (1) if the call is successful, FALSE (0) if the call fails.
PEGetGroup 16-bit
SelectionFormula Declare Function PEGetGroupSelectionFormula
Lib "crpe.dll" (ByVal printJob As Integer,
(VB Syntax) TextHandle As Integer, TextLength As Integer)
As Integer
32-bit
Declare Function PEGetGroupSelectionFormula
Lib "crpe32.dll" (ByVal printJob As Integer,
TextHandle As Long, TextLength As Integer) As
Integer
PEGetGroup 16-bit
SelectionFormula function PEGetGroupSelectionFormula (
printJob: integer;
(Delphi Syntax) var textHandle: HWnd;
var textLength: integer
): Bool;
32-bit
function PEGetGroupSelectionFormula (
printJob: Word;
var textHandle: HWnd;
var textLength: Word
): Bool stdcall;
PEGetHandleString
This function will return the text that the string handle is pointing to.
The buffer will contain the normal text. This function is used in
conjunction with functions that return variable length strings. After
your program allocates a buffer of sufficient size, this function moves
the string from the string handle to the buffer.
Parameters textHandle
Specifies the pointer to the handle of the string containing the text of
interest.
buffer
Specifies the pointer to the character array into which you want to
copy the string.
bufferLength
Specifies the pointer to the length of the buffer in bytes, including the
terminating null byte.
Return Value TRUE (1) if the call is successful, FALSE (0) if the call fails.
Remarks ● You can only use this call once with a given string handle because
the string handle is discarded once the function is called. If you
expect to use the string later, you will need to save it.
● PEGetHandleString will copy at most BufferLength bytes,
ensuring that the string in the buffer is null-terminated.
NOTE: When you call the function that produces the string, it
returns a length that includes a provision for the null byte at the end
of the string. A buffer set to that length will hold the entire string
including the terminating null byte.
PEGetHandle 16-bit
String (VB Syntax) Declare Function PEGetHandleString Lib
"crpe.dll" (ByVal TextHandle As Integer, ByVal
Buffer As String, ByVal BufferLength As
Integer) As Integer
PEGetHandle 16-bit
String function PEGetHandleString (
textHandle: HWnd;
(Delphi Syntax) buffer: PChar;
bufferLength: integer
): Bool;
32-bit
function PEGetHandleString (
textHandle: HWnd;
buffer: PChar;
bufferLength: integer
): Bool stdcall;
PEGetJobStatus
Evaluates the status of a print job. You can use this function in a
number of programming situations, for example:
● to trigger error messages, i.e., when a print job fails (due to
insufficient memory, insufficient disk space, etc.) or,
● to trigger screen displays (hourglass, series of graphics, etc.) that
confirm to the user that work is in progress, or
● to find out whether a job was cancelled by the user after
PEStartPrintJob returns.
short CRPE_API PEGetJobStatus (
short printJob, //handle to print job
struct PEJobInfoFAR *jobInfo
//pointer to structure
);
Parameters printJob
Specifies the handle to the print job you want to query about its
printing status.
PEGetJobStatus 16-bit
(VB Syntax) Declare Function PEGetJobStatus Lib "crpe.dll"
(ByVal printJob As Integer, JobInfo As
PEJobInfo) As Integer
32-bit
Declare Function PEGetJobStatus Lib
"crpe32.dll" (ByVal printJob As Integer,
JobInfo As PEJobInfo) As Integer
PEGetJobStatus 16-bit
(Delphi Syntax) function PEGetJobStatus (
printJob: integer;
var jobInfo: PEJobInfo
): integer;
32-bit
function PEGetJobStatus (
printJob: Word;
var jobInfo: PEJobInfo
): smallint stdcall;
Parameters printJob
Specifies the handle to the print job you want to query to retrieve
margin information.
left
Specifies a pointer to the value of the left margin.
right
Specifies a pointer to the value of the right margin.
top
Specifies a pointer to the value of the top margin.
bottom
Specifies a pointer to the value of the bottom margin.
Return Value TRUE (1) if the call is successful, FALSE (0) if the call fails.
PEGetMargins 16-bit
(VB Syntax) Declare Function PEGetMargins Lib "crpe.dll"
(ByVal printJob As Integer, LeftMargin As
Integer, RightMargin As Integer, TopMargin As
Integer, BottomMargin As Integer) As Integer
32-bit
Declare Function PEGetMargins Lib "crpe32.dll"
(ByVal printJob As Integer, LeftMargin As
Integer, RightMargin As Integer, TopMargin As
Integer, BottomMargin As Integer) As Integer
PEGetMargins 16-bit
(Delphi Syntax) function PEGetMargins (
printJob: integer;
var left: Word;
var right: Word;
var top: Word;
var bottom: Word
): Bool;
32-bit
function PEGetMargins (
printJob: Word;
var left: integer;
var right: integer;
var top: integer;
var bottom: integer
): Bool stdcall;
PEGetMinimumSectionHeight
Parameters printJob
Specifies the handle to the print job you want to query to retrieve
information on minimum section height.
sectionCode
Specifies the code for the report section(s) for which you want to
retrieve information on minimum section height. See Working with
Section Codes, Page 428.
minimumHeight
Specifies a pointer to the minimum height you want to set for the
selected section(s).
Return Value TRUE (1) if the call is successful, FALSE (0) if the call fails.
PEGetMinimum 16-bit
SectionHeight Declare Function PEGetMinimumSectionHeight Lib
"crpe.dll" (ByVal printJob As Integer, ByVal
(VB Syntax) sectionCode As Integer, MinimumHeight As
Integer) As Integer
32-bit
Declare Function PEGetMinimumSectionHeight Lib
"crpe32.dll" (ByVal printJob As Integer, ByVal
sectionCode As Integer, MinimumHeight As
Integer) As Integer
32-bit
function PEGetMinimumSectionHeight (
printJob: Word;
sectionCode: integer;
var minimumHeight: Word
): Bool stdcall;
PEGetNDetailCopies
Parameters printJob
Specifies the handle of the print job from which you want to know
how many times each Details section is to be printed.
nDetailCopies
Holds the number of copies of the Details section to be printed.
Return Value TRUE (1) if the call is successful, FALSE (0) if the call fails.
PEGetNDetail 16-bit
Copies (VB Syntax) Declare Function PEGetNDetailCopies Lib
"crpe.dll" (ByVal printJob As Integer,
nDetailCopies As Integer) As Integer
32-bit
Declare Function PEGetNDetailCopies Lib
"crpe32.dll" (ByVal printJob As Integer,
nDetailCopies As Integer) As Integer
PEGetNDetail 16-bit
Copies function PEGetNDetailCopies (
printJob: integer;
(Delphi Syntax) var nDetailCopies: integer
): Bool;
32-bit
function PEGetNDetailCopies(
printJob: Word;
var nDetailCopies: integer
): Bool stdcall;
PEGetNFormulas
Parameters printJob
Specifies the handle to the print job you want to query to find the
number of formulas it contains.
PEGetNFormulas 16-bit
(VB Syntax) Declare Function PEGetNFormulas Lib "crpe.dll"
(ByVal printJob As Integer) As Integer
32-bit
Declare Function PEGetNFormulas Lib
"crpe32.dll" (ByVal printJob As Integer) As
Integer
PEGetNFormulas 16-bit
(Delphi Syntax) function PEGetNFormulas (
printJob: integer
): integer;
32-bit
function PEGetNFormulas(
printJob: Word
): smallint stdcall;
PEGetNGroups
PEGetNGroups 16-bit
(VB Syntax) Declare Function PEGetNGroups Lib "crpe.dll"
(ByVal printJob As Integer) As Integer
32-bit
Declare Function PEGetNGroups Lib "crpe32.dll"
(ByVal printJob As Integer) As Integer
PEGetNGroups 16-bit
(Delphi Syntax) function PEGetNGroups (
printJob: integer
): integer;
32-bit
function PEGetNGroups (
printJob: Word
): smallint stdcall;
PEGetNGroupSortFields
Returns the number of group sort fields in the specified report. This
function is typically used as one of a series of functions:
PEGetNGroupSortFields (called once), PEGetNthGroupSortField/
PEGetHandleString (called as many times as needed to identify the
Parameters printJob
Specifies the handle of the print job you want to query to find out
how many group sort fields it contains.
Return Value If group sort fields have been defined, returns the number of such
fields; if there are no group sort fields defined, returns 0; if an error
occurs, returns -1.
PEGetNGroupSort 16-bit
Fields (VB Syntax) Declare Function PEGetNGroupSortFields Lib
"crpe.dll" (ByVal printJob As Integer) As
Integer
32-bit
Declare Function PEGetNGroupSortFields Lib
"crpe32.dll" (ByVal printJob As Integer) As
Integer
PEGetNGroupSort 16-bit
Fields function PEGetNGroupSortFields (
printJob: integer
(Delphi Syntax) ): integer;
PEGetNPages
Parameters printJob
Specifies the handle of the print job for which you want to determine
the number of pages.
PEGetNPages 16-bit
(VB Syntax) Declare Function PEGetNPages Lib "crpe.dll"
(ByVal printJob As Integer) As Integer
PEGetNPages 16-bit
(Delphi Syntax) function PEGetNPages (
printJob: integer
): integer;
32-bit
function PEGetNPages (
printJob: Word
): smallint stdcall;
PEGetNParameterFields
Parameters printJob
Specifies the handle of the print job from which you want to retrieve
a parameter field count.
PEGetNParameter 16-bit
Fields (VB Syntax) Declare Function PEGetNParameterFields Lib
"crpe.dll" (ByVal printJob As Integer) As
Integer
PEGetNParameter 16-bit
Fields function PEGetNParameterFields (
printJob: integer
(Delphi Syntax) ): integer;
32-bit
function PEGetNParameterFields (
printJob: Word
): Smallint stdcall;
PEGetNParams
Parameters printJob
Specifies the handle to the print job containing the stored procedure you
need to query to find out the number of parameters required by the
procedure.
PEGetNParams 16-bit
(VB Syntax) Declare Function PEGetNParams Lib "crpe.dll"
(ByVal printJob As Integer) As Integer
32-bit
Declare Function PEGetNParams Lib "crpe32.dll"
(ByVal printJob As Integer) As Integer
PEGetNParams 16-bit
(Delphi Syntax) function PEGetNParams (
printJob: integer
): integer;
32-bit
function PEGetNParams (
printJob: Word
): smallint stdcall;
PEGetNSections
Remarks For information on section codes, see Working with Section Codes,
Page 428.
PEGetNSections 16-bit
(VB Syntax) Declare Function PEGetNSections Lib "crpe.dll"
(ByVal printJob As Integer) As Integer
32-bit
Declare Function PEGetNSections Lib
"crpe32.dll" (ByVal printJob As Integer) As
Integer
PEGetNSections 16-bit
(Delphi Syntax) function PEGetNSections (
printJob: integer
): integer;
32-bit
function PEGetNSections (
printJob: Word
): Smallint stdcall;
PEGetNSortFields
Parameters printJob
Specifies the handle to the print job you want to query to find out
how many sort fields it contains.
Return Value If there are sort fields defined, returns the number of sort fields; if
there are no sort fields defined, returns 0; if an error occurs, returns -1.
PEGetNSortFields 16-bit
(VB Syntax) Declare Function PEGetNSortFields Lib
"crpe.dll" (ByVal printJob As Integer) As
Integer
32-bit
Declare Function PEGetNSortFields Lib
"crpe32.dll" (ByVal printJob As Integer) As
Integer
PEGetNSortFields 16-bit
(Delphi Syntax) function PEGetNSortFields (
printJob: integer
): integer;
32-bit
function PEGetNSortFields (
printJob: Word
): smallint stdcall;
PEGetNSubreportsInSection
PEGetNSubreports 16-bit
InSection Declare Function PEGetNSubreportsInSection Lib
"crpe.dll" (ByVal printJob As Integer, ByVal
(VB Syntax) sectionCode As Integer) As Integer
32-bit
Declare Function PEGetNSubreportsInSection Lib
"crpe32.dll" (ByVal printJob As Integer, ByVal
sectionCode As Integer) As Integer
32-bit
function PEGetNSubreportsInSection (
printJob: Word;
sectionCode: Smallint
): Smallint stdcall;
Related Topics
Working with subreports 36
PEGetNTables
Return Value Returns the number of tables used in the report (1 = 1 table, 2 = 2
tables, etc.); returns -1 if an error occurs.
Remarks This function can be used with all compatible PC databases (e.g.
Paradox, xBase) as well as SQL databases (e.g., SQL Server, Oracle,
Netware).
PEGetNTables 16-bit
(VB Syntax) Declare Function PEGetNTables Lib "crpe.dll"
(ByVal printJob As Integer) As Integer
32-bit
Declare Function PEGetNTables Lib "crpe32.dll"
(ByVal printJob As Integer) As Integer
PEGetNTables 16-bit
(Delphi Syntax) function PEGetNTables (
printJob: integer
): integer;
32-bit
function PEGetNTables (
printJob: Word
): smallint stdcall;
PEGetNthFormula
Parameters printJob
Specifies the handle to the print job from which you want to gather
formula information.
formulaN
Specifies the number of the formula about which you want to gather
information.
nameHandle
Specifies a pointer to the handle of the string containing the formula
name.
nameLength
Specifies a pointer to the length of the formula name string (in bytes)
including the terminating byte.
textHandle
Specifies a pointer to the handle of the string containing the formula
text.
textLength
Specifies a pointer to the length of the formula string (in bytes)
including the terminating byte.
Return Value TRUE (1) if the call is successful, FALSE (0) if the call fails.
PEGetNthFormula 16-bit
(VB Syntax) Declare Function PEGetNthFormula Lib "crpe.dll"
(ByVal printJob As Integer, ByVal FormulaN As
Integer, NameHandle As Integer, NameLength As
Integer, TextHandle As Integer, TextLength As
Integer) As Integer
32-bit
Declare Function PEGetNthFormula Lib
"crpe32.dll" (ByVal printJob As Integer, ByVal
FormulaN As Integer, NameHandle As Long,
NameLength As Integer, TextHandle As Long,
TextLength As Integer) As Integer
PEGetNthFormula 16-bit
(Delphi Syntax) function PEGetNthFormula (
printJob: integer;
formulaN: integer;
var nameHandle: HWnd;
var nameLength: integer;
var textHandle: HWnd;
var textLength: integer
): Bool;
32-bit
function PEGetNthFormula (
printJob: Word;
formulaN: integer;
var nameHandle: Hwnd;
var nameLength: Word;
var textHandle: Hwnd;
var textLength: Word
): Bool stdcall;
Parameters printJob
Specifies the handle of the print job from which you want to gather
group sort field information.
sortFieldN
Specifies the number of the group sort field you want to retrieve. The
first group sort field is field 0. If the report has N sort fields, the
function can be called with sortFieldN between 0 and N-1.
nameHandle
Specifies the pointer to the handle of the string containing the sort
field name.
nameLength
Specifies the pointer to the length of the field name string (in bytes)
including the terminating byte.
Value Meaning
PE_SF_ASCENDING Sorts in Ascending order (A to Z, 1 to
9).
PE_SF_DESCENDING Sorts in Descending order (Z to A, 9
to 1).
Return Value TRUE (1) if the call is successful; FALSE (0) if the call fails.
PEGetNthGroup 16-bit
SortField Declare Function PEGetNthGroupSortField Lib
"crpe.dll" (ByVal printJob As Integer, ByVal
(VB Syntax) SortFieldN As Integer, NameHandle As Integer,
NameLength As Integer, Direction As Integer) As
Integer
32-bit
Declare Function PEGetNthGroupSortField Lib
"crpe32.dll" (ByVal printJob As Integer, ByVal
SortFieldN As Integer, NameHandle As Long,
NameLength As Integer, Direction As Integer) As
Integer
PEGetNthGroup 16-bit
SortField function PEGetNthGroupSortField (
printJob: integer;
(Delphi Syntax) sortFieldN: integer;
var nameHandle: HWnd;
var nameLength: integer;
var direction: integer
): Bool;
PEGetNthParam
Parameters printJob
Specifies the handle of the print job that contains the stored
procedure for which you are interested in obtaining a parameter.
paramN
0 indexed parameter number, indicates which parameter in the
stored procedure you wish to know.
textHandle
Specifies the pointer to the handle of the string containing the sort
procedure parameter.
textLength
Specifies the pointer to the length of the parameter string (in bytes)
including the terminating null byte.
PEGetNthParam 16-bit
(VB Syntax) Declare Function PEGetNthParam Lib "crpe.dll"
(ByVal printJob As Integer, ByVal ParamN As
Integer, TextHandle As Integer, TextLength As
Integer) As Integer
32-bit
Declare Function PEGetNthParam Lib "crpe32.dll"
(ByVal printJob As Integer, ByVal paramN As
Integer, TextHandle As Long, TextLength As
Integer) As Integer
PEGetNthParam 16-bit
(Delphi Syntax) function PEGetNthParam (
printJob: integer;
paramN: integer;
var textHandle: HWnd;
var textLength: integer
): Bool;
32-bit
function PEGetNthParam(
printJob: Word;
paramN: integer;
PEGetNthParameterField
Parameters printJob
Specifies the handle of the print job that contains the parameter field
about which you want to retrieve information.
parameterN
Specifies the number of the parameter field about which you want to
retrieve information.
parameterInfo
Specifies a pointer to the PEParameterFieldInfo structure (see Page
680) that is used to store the information you retrieve.
Return Value TRUE (1) if the call is successful; FALSE (0) if the call fails.
PEGetNth 16-bit
ParameterField Declare Function PEGetNthParameterField Lib
"crpe.dll" (ByVal printJob As Integer, ByVal
(VB Syntax) varN As Integer, varInfo As
PEParameterFieldInfo) As Integer
32-bit
Declare Function PEGetNthParameterField Lib
"crpe32.dll" (ByVal printJob As Integer, ByVal
varN As Integer, varInfo As
PEParameterFieldInfo) As Integer
PEGetNth 16-bit
ParameterField function PEGetNthParameterField (
printJob: integer;
(Delphi Syntax) varN: integer;
var varInfo: PEParameterFieldInfo
): Bool;
32-bit
function PEGetNthParameterField (
printJob: Word;
varN: Smallint;
var varInfo: PEParameterFieldInfo
): Bool stdcall;
PEGetNthParamInfo
Return Value TRUE (1) if the call is successful; FALSE (0) if the call fails.
PEGetNthParam 16-bit
Info (VB Syntax) Declare Function PEGetNthParamInfo Lib
"crpe.dll" (ByVal printJob As Integer, ByVal
ParamN As Integer, paramInfo As
PEParameterInfo) As Integer
32-bit
Declare Function PEGetNthParamInfo Lib
"crpe32.dll" (ByVal printJob As Integer, ByVal
paramN As Integer, paramInfo As
PEParameterInfo) As Integer
PEGetNth 16-bit
ParamInfo function PEGetNthParamInfo (
printJob: integer;
(Delphi Syntax) paramN: integer;
var paramInfo: PEParameterInfo
):Bool;
32-bit
function PEGetNthParamInfo (
printJob: Word;
paramN: Smallint;
var paramInfo: PEParameterInfo
): Bool stdcall;
Parameters printJob
Specifies the handle to the print job from which you want to retrieve
sort field information.
sortFieldN
Specifies the number of the sort field you want to retrieve. The first
sort field is field 0. If the report has N sort fields, the function can be
called with sortFieldN between 0 and N-1.
nameHandle
Specifies the pointer to the handle of the string containing the sort
field name.
nameLength
Specifies the pointer to the length of the field name string (in bytes)
including the terminating byte.
direction
Specifies the sort direction. Use one of the following values:
Return Value TRUE (1) if the call is successful; FALSE (0) if the call fails.
PEGetNthSortField 16-bit
(VB Syntax) Declare Function PEGetNthSortField Lib
"crpe.dll" (ByVal printJob As Integer, ByVal
SortNumber As Integer, NameHandle As Integer,
NameLength As Integer, Direction As Integer) As
Integer
32-bit
Declare Function PEGetNthSortField Lib
"crpe32.dll" (ByVal printJob As Integer, ByVal
SortNumber As Integer, NameHandle As Long,
NameLength As Integer, Direction As Integer) As
Integer
PEGetNthSortField 16-bit
(Delphi Syntax) function PEGetNthSortField (
printJob: integer;
sortFieldN: integer;
var nameHandle: HWnd;
var nameLength:integer;
var direction: integer
): Bool;
PEGetNthSubreportInSection
Parameters printJob
Specifies the handle of the primary report
sectionCode
Specifies the code for the report section that contains the subreport.
See Working with Section Codes, Page 428.
subreportN
Specifies the number of the subreport in the specified section.
subreportN is zero based. The first report in the section will be 0, the
second will be 1, etc. If there are no subreports in the section, the
function will return 0.
PEGetNth 16-bit
Subreport Declare Function PEGetNthSubreportInSection
Lib "crpe.dll" (ByVal printJob As Integer,
InSection ByVal sectionCode As Integer, ByVal subreportN
(VB Syntax) As Integer) As Long
32-bit
Declare Function PEGetNthSubreportInSection
Lib "crpe32.dll" (ByVal printJob As Integer,
ByVal sectionCode As Integer, ByVal subreportN
As Integer) As Long
PEGetNth 16-bit
SubreportIn function PEGetNthSubreportInSection (
printJob: integer;
Section sectionCode: integer;
(Delphi Syntax) subreportN: integer
): Longint;
32-bit
function PEGetNthSubreportInSection (
printJob: Word;
sectionCode: Smallint
subreportN: Smallint
): DWord stdcall;
Related Topics
Working with subreports 36
PEGetNthTableLocation
Parameters printJob
Specifies the handle of the print job from which you want to retrieve
information about a table’s location.
tableN
Specifies the number of the table for which you want to retrieve
location information. The first table is table 0.
location
Specifies the pointer to the PETableLocation structure (see Page 696).
Return Value TRUE (1) if the call is successful; FALSE (0) if the call fails.
PEGetNthTable 16-bit
Location Declare Function PEGetNthTableLocation Lib
"crpe.dll" (ByVal printJob As Integer, ByVal
(VB Syntax) TableN As Integer, Location As PETableLocation)
As Integer
32-bit
Declare Function PEGetNthTableLocation Lib
"crpe32.dll" (ByVal printJob As Integer, ByVal
TableN As Integer, Location As PETableLocation)
As Integer
32-bit
function PEGetNthTableLocation(
printJob: Word;
tableN: integer;
var location: PETableLocation
): Bool stdcall;
PEGetNthTableLogOnInfo
Parameters printJob
Specifies the handle of the print job for which you want to get table
log on information.
tableN
Specifies the number of the table from which you want to get log on
information. The first table is table 0.
logOnInfo
Specifies the pointer to the PELogOnInfo structure.
Return Value TRUE (1) if the call is successful; FALSE (0) if the call fails.
Remarks ● This function must be called after PEOpenPrintJob (so you have
the job handle) and before PEStartPrintJob (which needs the
password set to print the report).
PEGetNthTable 16-bit
LogOnInfo Declare Function PEGetNthTableLogOnInfo Lib
"crpe.dll" (ByVal printJob As Integer, ByVal
(VB Syntax) TableN As Integer, LogOnInfo As PELogOnInfo) As
Integer
32-bit
Declare Function PEGetNthTableLogOnInfo Lib
"crpe32.dll" (ByVal printJob As Integer, ByVal
TableN As Integer, LogOnInfo As PELogOnInfo) As
Integer
PEGetNthTable 16-bit
LogOnInfo function PEGetNthTableLogOnInfo (
printJob: integer;
(Delphi Syntax) tableN: integer;
var logOnInfo: PELogOnInfo
): Bool;
32-bit
function PEGetNthTableLogOnInfo (
printJob: Word;
tableN: integer;
var logOnInfo: PELogOnInfo
): Bool stdcall;
PEGetNthTableSessionInfo
Parameters printJob
Identifies the handle of the print job that uses the table for which you
need to obtain the session information.
tableN
0 indexed table number indicating which table in the report you wish
to obtain the session information for.
sessionInfo
Refer to the PESessionInfo structure for further information.
Return Value TRUE (1) if the call is successful, FALSE (0) if the call fails.
PEGetNthTable 16-bit
SessionInfo Declare Function PEGetNthTableSessionInfo Lib
"crpe.dll" (ByVal printJob As Integer, ByVal
(VB Syntax) TableN As Integer, SessionInfo As
PESessionInfo) As Integer
32-bit
Declare Function PEGetNthTableSessionInfo Lib
"crpe32.dll" (ByVal printJob As Integer, ByVal
TableN As Integer, SessionInfo As
PESessionInfo) As Integer
32-bit
function PEGetNthTableSessionInfo (
printJob: Word;
tableN: integer;
var sessionInfo: PESessionInfo
): Bool stdcall;
PEGetNthTableType
Parameters printJob
Specifies the handle of the print job for which you want to determine
a table type.
tableN
Specifies the number of the table for which you want to determine
the type. Table numbers start at 0. For example, if PEGetNTables
returns 2, call PEGetNthTableType twice with table numbers of 0
and 1.
tableType
Specifies the pointer to the PETableType structure.
PEGetNthTable 16-bit
Type (VB Syntax) Declare Function PEGetNthTableType Lib
"crpe.dll" (ByVal printJob As Integer, ByVal
TableN As Integer, TableType As PETableType) As
Integer
32-bit
Declare Function PEGetNthTableType Lib
"crpe32.dll" (ByVal printJob As Integer, ByVal
TableN As Integer, TableType As PETableType) As
Integer
PEGetNthTable 16-bit
Type function PEGetNthTableType (
printJob: integer;
(Delphi Syntax) tableN: integer;
var tableType: PETableType
): Bool;
PEGetPrintDate
Determines the print date (if any) that was specified with the report.
Use this function to fetch the print date and pass back using
PESetPrintDate.
BOOL CRPE_API PEGetPrintDate (
short printJob,//handle to print job
short FAR *year,
//pointer to print date year component
short FAR *month,
//pointer to print date month component
short FAR *day
//pointer to print date day component
);
Parameters printJob
Specifies the handle of the print job you want to query to determine
its print date setting.
year
Specifies a pointer to the year component of the print date.
month
Specifies a pointer to the month component of the print date.
day
Specifies a pointer to the day component of the print date.
Return Value TRUE (1) if the call is successful, FALSE (0) if the call fails.
Remarks You change the print date, typically, when you want to run the
report today yet have it appear to have been run on a different date.
An example would be, if you were out of town on the last day of the
previous month and you later want to run a report for that month
and make it appear as if it were run on the last day of the month.
PEGetPrintDate 16-bit
(VB Syntax) Declare Function PEGetPrintDate Lib "crpe.dll"
(ByVal printJob As Integer, Date_Year As
Integer, Date_Month As Integer, Date_Day As
Integer) As Integer
32-bit
Declare Function PEGetPrintDate Lib
"crpe32.dll" (ByVal printJob As Integer,
Date_Year As Integer, Date_Month As Integer,
Date_Day As Integer) As Integer
PEGetPrintDate 16-bit
(Delphi Syntax) function PEGetPrintDate (
printJob: integer;
var year: integer;
var month: integer;
var day: integer
): Bool;
32-bit
function PEGetPrintDate (
printJob: Word;
var year: Word;
var month: Word;
var day: Word
): Bool stdcall;
PEGetPrintOptions
Parameters printJob
Specifies the handle of the print job you want to query to find out
which print options have been set using the Print common dialog
box.
options
Specifies the pointer to the PEPrintOptions structure.
Return Value TRUE (1) if the call is successful, FALSE (0) if the call fails.
PEGetPrintOptions 16-bit
(VB Syntax) Declare Function PEGetPrintOptions Lib
"crpe.dll" (ByVal printJob As Integer, Options
As PEPrintOptions) As Integer
32-bit
Declare Function PEGetPrintOptions Lib
"crpe32.dll" (ByVal printJob As Integer,
Options As PEPrintOptions) As Integer
32-bit
function PEGetPrintOptions (
printJob: Word;
var options: PEPrintOptions
): Bool stdcall;
PEGetReportTitle
Parameters printJob
Specifies the handle of the print job for which you want to get the
report title.
titleHandle
Specifies a pointer to the handle of the string containing the window
title.
titleLength
Specifies a pointer to the length of the window title string (in bytes)
including the terminating byte.
PEGetReportTitle 16-bit
(VB Syntax) Declare Function PEGetReportTitle Lib
"crpe.dll" (ByVal printJob As Integer,
TitleHandle As Integer, TitleLength As Integer)
As Integer
32-bit
Declare Function PEGetReportTitle Lib
"crpe32.dll" (ByVal printJob As Integer,
TitleHandle As Long, TitleLength As Integer) As
Integer
PEGetReportTitle 16-bit
(Delphi Syntax) function PEGetReportTitle (
printJob: integer;
var titleHandle: HWnd;
var titleLength: integer
): Bool;
32-bit
function PEGetReportTitle (
printJob: Word;
var titleHandle: HWnd;
var titleLength: Word
): Bool stdcall;
PEGetSectionCode
Parameters printJob
Specifies the handle of the print job from which you want to identify
a section code.
sectionN
Specifies the number of the section for which you want the section
code. See Working with Section Codes, Page 428.
Return value The section code for the specified section. See Working with Section
Codes, Page 428.
PEGetSectionCode 16-bit
(VB Syntax) Declare Function PEGetSectionCode Lib
"crpe.dll" (ByVal printJob As Integer, ByVal
sectionN As Integer) As Integer
32-bit
Declare Function PEGetSectionCode Lib
"crpe32.dll" (ByVal printJob As Integer, ByVal
sectionN As Integer) As Integer
PEGetSectionCode 16-bit
(Delphi Syntax) function PEGetSectionCode (
printJob: integer;
sectionN: integer
): integer;
PEGetSectionFormat
Parameters printJob
Specifies the handle of the print job you want to query to find what
section options have been set for the report using the Format Section
dialog box.
sectionCode
Specifies the code for the report section(s) for which you want to get
section format information. See Working with Section Codes, Page 428.
options
Specifies the pointer to the PESectionOptions structure.
Return Value TRUE (1) if the call is successful, FALSE (0) if the call fails.
PEGetSection 16-bit
Format Declare Function PEGetSectionFormat Lib
"crpe.dll" (ByVal printJob As Integer, ByVal
(VB Syntax) sectionCode As Integer, Options As
PESectionOptions) As Integer
32-bit
Declare Function PEGetSectionFormat Lib
"crpe32.dll" (ByVal printJob As Integer, ByVal
sectionCode As Integer, Options As
PESectionOptions) As Integer
PEGetSection 16-bit
Format function PEGetSectionFormat (
printJob: integer;
(Delphi Syntax) sectionCode: integer;
var options: PESectionOptions
): Bool;
32-bit
function PEGetSectionFormat (
printJob: Word;
sectionCode: integer;
var options: PESectionOptions
): Bool stdcall;
PEGetSelectedPrinter
Parameters printJob
Specifies the handle to the print job that you want to query to get
information on the non-default printer that has been selected with
the report.
driverHandle
Specifies a pointer to the handle of the printer driver for the printer
that is selected with the print job.
driverLength
Specifies a pointer to the length of the printer driver name.
printerHandle
Specifies a pointer to the handle of the printer that is selected with
the print job.
printerLength
Specifies a pointer to the length of the printer name.
portHandle
Specifies a pointer to the handle of the port to which the selected
printer is connected.
portLength
Specifies a pointer to the length of the port name.
mode
Specifies the pointer to the DEVMODE structure.
PEGetSelected 16-bit
Printer Declare Function PEGetSelectedPrinter Lib
"crpe.dll" (ByVal printJob As Integer,
(VB Syntax) DriverHandle As Integer, DriverLength As
Integer, PrinterHandle As Integer,
PrinterLength As Integer, PortHandle As
Integer, PortLength As Integer, DevMode As Any)
As Integer
32-bit
Declare Function PEGetSelectedPrinter Lib
"crpe32.dll" (ByVal printJob As Integer,
DriverHandle As Long, DriverLength As Integer,
PrinterHandle As Long, PrinterLength As
Integer, PortHandle As Long, PortLength As
Integer, DevMode As Any) As Integer
PEGetSelected 16-bit
Printer function PEGetSelectedPrinter (
printJob: integer;
(Delphi Syntax) var driverHandle: HWnd;
var driverLength: integer;
var printerHandle: HWnd;
var printerLength: integer;
var portHandle: HWnd;
var portLength: integer;
var mode: PDevMode
): Bool;
PEGetSelectionFormula
Returns the string handle for the selection formula used in the
specified report. This function is typically used as one of a series of
functions (PEGetSelectionFormula, PEGetHandleString,
PESetSelectionFormula). The series can be used in a custom-print
link to identify and then change an existing record selection formula
at print time in response to a user selection.
BOOL CRPE_API PEGetSelectionFormula (
short printJob,//handle to print job
HANDLE FAR *textHandle,
//pointer to formula string handle
short FAR *textLength
//pointer to formula string length
);
Parameters printJob
Specifies the handle of the print job for which you want to retrieve
the selection formula string.
textHandle
Specifies the pointer to the handle of the string containing the
formula text.
textLength
Specifies the pointer to the length of the formula string (in bytes)
including the terminating byte.
Return Value TRUE (1) if the call is successful, FALSE (0) if the call fails.
PEGetSelection 16-bit
Formula Declare Function PEGetSelectionFormula Lib
"crpe.dll" (ByVal printJob As Integer,
(VB Syntax) TextHandle As Integer, TextLength As Integer)
As Integer
32-bit
Declare Function PEGetSelectionFormula Lib
"crpe32.dll" (ByVal printJob As Integer,
TextHandle As Long, TextLength As Integer) As
Integer
PEGetSelection 16-bit
Formula function PEGetSelectionFormula (
printJob: integer;
(Delphi Syntax) var textHandle: HWnd;
var textLength: integer
): Bool;
32-bit
function PEGetSelectionFormula (
printJob: Word;
var textHandle: HWnd;
var textLength: Word
): Bool stdcall;
PEGetSQLQuery
Parameters printJob
Specifies the handle to the print job from which you want to retrieve
the SQL query.
textHandle
Specifies the pointer to the handle of the string containing the SQL
query string.
textLength
Specifies the pointer to the length of the SQL query string (in bytes)
including the terminating byte.
Return Value TRUE (1) if the call is successful, (0) if an error occurs.
PEGetSQLQuery 16-bit
(VB Syntax) Declare Function PEGetSQLQuery Lib "crpe.dll"
(ByVal printJob As Integer, TextHandle As
Integer, TextLength As Integer) As Integer
PEGetSQLQuery 16-bit
(Delphi Syntax) function PEGetSQLQuery (
printJob: integer;
var textHandle: HWnd;
var textLength: integer
): Bool;
32-bit
function PEGetSQLQuery (
printJob: Word;
var textHandle: HWnd;
var textLength: Word
): Bool stdcall;
PEGetSubreportInfo
Parameters printJob
Specifies the handle of the primary report that contains the subreport
about which you want to retrieve information.
subreportHandle
Specifies the handle of the subreport about which you want to
retrieve information.
Return Value TRUE (1) if the call is successful, FALSE (0) if the call fails.
PEGetSubreport 16-bit
Info (VB Syntax) Declare Function PEGetSubreportInfo Lib
"crpe.dll" (ByVal printJob As Integer, ByVal
subreportHandle As Long, subreportInfo As
PESubreportInfo) As Integer
32-bit
Declare Function PEGetSubreportInfo Lib
"crpe32.dll" (ByVal printJob As Integer, ByVal
subreportHandle As Long, subreportInfo As
PESubreportInfo) As Integer
PEGetSubreport 16-bit
Info function PEGetSubreportInfo (
printJob: integer;
(Delphi Syntax) subreportHandle: Longint;
var subreportInfo: PESubreportInfo
): Bool;
32-bit
function PEGetSubreportInfo (
printJob: Word;
subreportHandle: DWord;
var subreportInfo: PESubreportInfo
): Bool stdcall;
Related Topics
Working with subreports 36
Returns the version number of the DLL or the Report Engine. The
high-order byte is the major version number and the low-order byte
is the minor version number. This function can be used whenever
you build functionality into a report that may not be available in
earlier versions of the Report Engine and you need to verify the
version number first. The function can be a handy safeguard for
users who have more than one version of the Report Engine with the
older version earlier in the path than the new version.
short CRPE_API PEGetVersion (
short versionRequested
//code specifying DLL or Report Engine
);
Parameters versionRequested
Specifies whether the DLL or Report Engine version is being
requested. Use one of the following values:
Value Meaning
PE_GV_DLL Returns the version of the DLL
(CRPE.DLL/CRPE32.DLL).
PE_GV_ENGINE Returns the version of the Report
Engine.
Return Value The version number of the DLL or the Crystal Report Engine.
PEGetVersion 16-bit
(VB Syntax) Declare Function PEGetVbVersion Lib "crpe.dll"
(ByVal Version As Integer) As Integer
32-bit
Declare Function PEGetVbVersion Lib
"crpe32.dll" (ByVal Version As Integer) As
Integer
32-bit
function PEGetVersion (
versionRequested: integer
): smallint stdcall;
PEGetWindowHandle
Returns the handle of the print window. This function can be used in
a custom-print link if you want to do something with the print
window (move it, change its size, etc.)
PEGetWindowHandle can also be used to determine if the user has
already closed the print window.
HWND CRPE_API PEGetWindowHandle (
short printJob//handle to print job
);
Parameters printJob
Specifies the handle of the print job from which you want to retrieve
the print window handle. If two or more print windows are open,
this function applies only to the most recently created print window.
Return Value This function returns the print window handle if it is successful, 0 if
an error occurs or if the print window has already been closed.
Remarks This function can be used after the PEStartPrintJob call, and then,
only if you have created a print window.
PEGetWindow 16-bit
Handle Declare Function PEGetWindowHandle Lib
"crpe.dll" (ByVal printJob As Integer) As
(VB Syntax) Integer
32-bit
Declare Function PEGetWindowHandle Lib
"crpe32.dll" (ByVal printJob As Integer) As
Integer
PEGetWindow 16-bit
Handle function PEGetWindowHandle (
printJob: integer
(Delphi Syntax) ): HWnd;
32-bit
function PEGetWindowHandle (
printJob: Word
): HWnd stdcall;
PEHasSavedData
Parameters printJob
Specifies the handle to the print job you want to query to find if it has
saved data.
hasSavedData
Specifies a pointer to a memory address that indicates whether or not
there is data saved with the report.
Return Value TRUE (1) if the call is successful, FALSE (0) if the call fails.
Remarks A report may or may not have saved data when a print job is first
opened from a report file. Since data is saved during a print,
however, it will always have saved data immediately after a report
is printed.
Use PEDiscardSavedData to release the saved data associated with a
report. The next time the report is printed, it will get current data
from the database.
The default behavior is for a report to use its saved data rather than
refresh its data from the database when printing a report.
PEHasSavedData 16-bit
(VB Syntax) Declare Function PEHasSavedData Lib "crpe.dll"
(ByVal printJob As Integer, HasSavedData As
Integer) As Integer
PEHasSavedData 16-bit
(Delphi Syntax) function PEHasSavedData (
printJob: integer;
var hasSavedData: Bool
):Bool;
32-bit
function PEHasSavedData(
printJob: Word;
var hasSavedData: Bool
): Bool stdcall;
PEIsPrintJobFinished
Parameters printJob
Specifies the handle to the print job you are querying to find if it has
finished printing.
Return Value TRUE (1) if the call is successful, FALSE (0) if the call fails.
PEIsPrintJob 16-bit
Finished Declare Function PEIsPrintJobFinished Lib
"crpe.dll" (ByVal printJob As Integer) As
(VB Syntax) Integer
32-bit
Declare Function PEIsPrintJobFinished Lib
"crpe32.dll" (ByVal printJob As Integer) As
Integer
PEIsPrintJob 16-bit
Finished function PEIsPrintJobFinished (
printJob: integer
(Delphi Syntax) ):Bool;
32-bit
function PEIsPrintJobFinished (
printJob: Word
): Bool stdcall;
PELogOffServer
Logs off the specified server. Use any time you have to log off a
specified server.
BOOL CRPE_API PELogOffServer (
char FAR *dllName,//pointer to name of
datasource DLL
struct PELogOnInfo FAR *logOnInfo
//structure pointer
);
Return Value TRUE (1) if the call is successful, FALSE (0) if the call fails.
PELogOffServer 16-bit
(VB Syntax) Declare Function PELogOffServer Lib "crpe.dll"
(ByVal DLLName As String, LogOnInfo As
PELogOnInfo) As Integer
32-bit
Declare Function PELogOffServer Lib
"crpe32.dll" (ByVal DLLName As String,
LogOnInfo As PELogOnInfo) As Integer
32-bit
function PELogOffServer(
dllName: PChar;
var logOnInfo: PELogOnInfo
): Bool stdcall;
PELogOnServer
Parameters dllName
Specifies the name of the Crystal Reports DLL for the server or
password protected non-SQL table you want to log onto, for
example, "PDSODBC.DLL". Note that the dllName must be enclosed
in quotes. DLL names have the following naming convention:
PDB*.DLL for standard (non-SQL) databases, PDS*.DLL for SQL/
ODBC databases.
logOnInfo
Specifies the pointer to the PELogOnInfo structure.
Return Value TRUE (1) if the call is successful, FALSE (0) if the call fails.
Remarks The actual file name is needed for both 32-bit and 16-bit.
PELogOnServer 16-bit
(VB Syntax) Declare Function PELogOnServer Lib "crpe.dll"
(ByVal DLLName As String, LogOnInfo As
PELogOnInfo) As Integer
32-bit
Declare Function PELogOnServer Lib "crpe32.dll"
(ByVal DLLName As String, LogOnInfo As
PELogOnInfo) As Integer
32-bit
function PELogOnServer(
dllName: PChar;
var logOnInfo: PELogOnInfo
): Bool stdcall;
PELogOnSQLServerWithPrivateInfo
Parameters dllName
Specifies the name of the Crystal Reports DLL that was used in
establishing the connection to the server when the report was first
created. Thus, if a report was created using an ODBC datasource, the
Crystal Reports DLL is PDSODBC.DLL.
privateInfo
In the application, a connection to the server has to have been
established and this in turn generates a Handle to a Database
Connection (HDBC). This parameter specifies the application’s
handle to the connection. This makes Crystal Reports aware of the
existing connection so it can use it instead of establishing a new one.
Return Value TRUE (1) if the call is successful; FALSE (0) if the call fails.
PELogOnSQL 16-bit
ServerWithPrivate Declare Function
PELogOnSQLServerWithPrivateInfo Lib "crpe.dll"
Info (VB Syntax) (ByVal DLLName As String, ByVal PrivateInfo As
Long) As Integer
32-bit
Declare Function
PELogOnSQLServerWithPrivateInfo Lib
"crpe32.dll" (ByVal DLLName As String, ByVal
PrivateInfo As Long) As Integer
32-bit
function PELogOnSQLServerWithPrivateInfo (
dllName: PChar;
privateInfo: Pointer
): Bool stdcall;
PENextPrintWindowMagnification
Parameters printJob
The handle of the print job for the report appearing in the print
window.
Return Value TRUE (1) if the call is successful, FALSE (0) if the call fails.
PENextPrint 16-bit
Window Declare Function
PENextPrintWindowMagnification Lib "crpe.dll"
Magnification (ByVal printJob As Integer) As Integer
(VB Syntax)
32-bit
Declare Function
PENextPrintWindowMagnification Lib
"crpe32.dll" (ByVal printJob As Integer) As
Integer
PENextPrint 16-bit
Window function PENextPrintWindowMagnification (
printJob: integer
Magnification ):Bool;
(Delphi Syntax)
32-bit
function PENextPrintWindowMagnification (
printJob: Word
): Bool stdcall;
PEOpenEngine
Return Value TRUE (1) if Action is satisfactory, FALSE (0) if the call fails.
Remarks This function must be called before any other Report Engine
function. If an error occurs in the PEOpenEngine function call,
PEGetErrorCode can be passed a print job value of zero to obtain
error information.
PEOpenEngine 16-bit
(VB Syntax) Declare Function PEOpenEngine Lib "crpe.dll" ()
As Integer
32-bit
Declare Function PEOpenEngine Lib "crpe32.dll"
() As Integer
PEOpenEngine 16-bit
(Delphi Syntax) function PEOpenEngine: Bool;
32-bit
function PEOpenEngine: Bool stdcall;
PEOpenPrintJob
Parameters reportFilePath
Specifies the file name and path of the report you want to open. You
must enclose this parameter in quotes.
Return Value Returns the job number if no error occurs; returns 0 if the report file
does not exist or if an error occurs.
Remarks ● This function must be called before most other Report Engine
functions are used.
● Only one print job can be configured at a time.
● PEClosePrintJob must be called later to close the job.
● Report Path\Filename must be enclosed in quotes, for example:
PEOpenPrintJob
("C:\CRW\REPORT1.RPT");
NOTE: In C or C++ the slashes in the string (\) must each be entered
as a double slash (\\).
This function opens the print job with the printer selected in the
report (via the Print|Select Printer menu command) or the default
printer (if no replacement printer has been selected in the report).
PEOpenPrintJob 16-bit
(VB Syntax) Declare Function PEOpenPrintJob Lib "crpe.dll"
(ByVal RptName As String) As Integer
PEOpenPrintJob 16-bit
(Delphi Syntax) function PEOpenPrintJob (
reportFilePath: PChar
):integer;
32-bit
function PEOpenPrintJob (
reportFilePath: PChar
): smallint stdcall;
PEOpenSubreport
Parameters parentJob
Specifies the handle of the primary report (the report that contains
the subreport). This is the handle returned from PEOpenPrintJob.
subreportName
Return Value Returns the job number of the subreport if no error occurs; returns 0
if the subreport does not exist or if an error occurs.
Remarks ● This function must be called before any other Report Engine
functions related to the subreport are used.
● PECloseSubreport must be called later to close the job.
PEOpenSubreport 16-bit
(VB Syntax) Declare Function PEOpenSubreport Lib "crpe.dll"
(ByVal parentJob As Integer, ByVal
subreportName As String) As Integer
32-bit
Declare Function PEOpenSubreport Lib
"crpe32.dll" (ByVal parentJob As Integer, ByVal
subreportName As String) As Integer
PEOpenSubreport 16-bit
(Delphi Syntax) function PEOpenSubreport (
parentJob: integer;
subreportName: PChar
): Integer;
32-bit
function PEOpenSubreport (
parentJob: Word;
subreportName: PChar
): Word stdcall;
Related Topics
Working with subreports 36
PEOpenPrintJob
// Opens the job with printer
// specified in report, or,
// if none is specified, the
// Windows default printer.
// The printer the job opens
// with is Printer #1.
PEOutputToWindow
// Directs the output to the
// print window.
PEStartPrintJob
// Report is printed in the
// print window based on
// Printer #1.
PEOutputToPrinter
// Directs output to the
// printer.
PEStartPrintJob
// Report is printed on
// Printer #2. Window output
// and printer output are
// based on two different
// printers and may cause
// confusion.
PEClosePrintJob
If one printer is set for landscape output, for example, and the other
for portrait output, the sequence of calls above will print an entirely
different report in the print window than what actually appears on
paper.
Make certain to sequence your function calls to get the output
desired.
BOOL CRPE_API PEOutputToPrinter (
short printJob,//handle to print job
short nCopies
//number of copies to be printed
);
Parameters printJob
Specifies the handle of the print job you want to send to a printer.
nCopies
Specifies the number of report copies you want printed.
Return Value TRUE (1) if the output can be sent to the printer successfully, FALSE
(0) if the output can not be sent to the printer.
PEOutputTo 16-bit
Printer Declare Function PEOutputToPrinter Lib
"crpe.dll" (ByVal printJob As Integer, ByVal
(VB Syntax) NCopies As Integer) As Integer
32-bit
Declare Function PEOutputToPrinter Lib
"crpe32.dll" (ByVal printJob As Integer, ByVal
nCopies As Integer) As Integer
PEOutputTo 16-bit
Printer function PEOutputToPrinter (
printJob: integer;
(Delphi Syntax) nCopies: integer
):Bool;
32-bit
function PEOutputToPrinter (
printJob: Word;
nCopies: integer
): Bool stdcall;
PEOutputToWindow
Parameters printJob
Specifies the handle of the print job you want to print in the print
window.
title
Specifies a pointer to the null-terminated string that contains the title
you want to appear in the print window title bar.
left
Specifies the x coordinate of the upper left corner of the print
window, in twips.*, **
top
Specifies the y coordinate of the upper left corner of the print
window, in twips..*, **
width
Specifies the width of the print window, in twips..*
height
Specifies the height of the print window, in twips..*
*A twip is 1/1440th of an inch or 1/20th of a point. To specify a width
of 5", for example, you would pass a value of 7200.
**For a top-level print window, the top left corner is relative to the
origin of the screen. For an MDI child print window, the top left
corner is relative to the origin of the frame window’s client area. For
a child print window, the top left corner is relative to the origin of the
parent window’s client area.
style
Specifies the style of the window being created. Style settings can be
combined using the bitwise "OR" operator.
Decimal
Value Style Setting Action
Return Value TRUE (1) if the output can be sent to the window successfully,
FALSE (0) if the output can not be sent to the window.
PEOutputTo 16-bit
Window Declare Function PEOutputToWindow Lib
"crpe.dll" (ByVal printJob As Integer, ByVal
(VB Syntax) Title As String, ByVal Left As Integer, ByVal
Top As Integer, ByVal Width As Integer, ByVal
Height As Integer, ByVal Style As Long, ByVal
PWindow As Integer) As Integer
32-bit
Declare Function PEOutputToWindow Lib
"crpe32.dll" (ByVal printJob As Integer, ByVal
Title As String, ByVal Left As Long, ByVal Top
As Long, ByVal Width As Long, ByVal Height As
Long, ByVal style As Long, ByVal PWindow As
Long) As Integer
PEOutputTo 16-bit
Window function PEOutputToWindow (
printJob: integer;
(Delphi Syntax) title: PChar;
left: integer;
top: integer;
width: integer;
height: integer;
style: longint;
parentWindow: HWnd
):Bool;
PEPrintControlsShowing
Parameters printJob
Specifies the handle for the print job for which you want to check if
the print controls will be displayed when the job is sent to a print
window.
controlsShowing
Returns a pointer to TRUE (1) if the print controls will be shown,
FALSE (0) if they will be hidden.
PEPrintControls 16-bit
Showing Declare Function PEPrintControlsShowing Lib
"crpe.dll" (ByVal printJob As Integer,
(VB Syntax) ControlsShowing As Integer) As Integer
32-bit
Declare Function PEPrintControlsShowing Lib
"crpe32.dll" (ByVal printJob As Integer,
ControlsShowing As Integer) As Integer
PEPrintControls 16-bit
Showing function PEPrintControlsShowing (
printJob: integer;
(Delphi Syntax) var controlsShowing: Bool
):Bool;
32-bit
function PEPrintControlsShowing (
printJob: Word;
var controlsShowing: Bool
): Bool stdcall;
PEPrintReport
Parameters reportFilePath
Specifies a pointer to the null-terminated string that contains the
name and path of the report you want to print.
toDefaultPrinter
Specifies whether or not the report is to be sent to the default printer.
toWindow
Specifies whether or not the report is to be displayed in the print
window.
title
Specifies a pointer to the null-terminated string that contains the title
you want to appear on the title bar if you are printing the report to a
window.
left
Specifies the x coordinate of the upper left hand corner of the print
window, in twips. A twip is 1/1440th of an inch or 1/20th of a point.
To specify a width of 5", for example, you would pass a value of 7200.
top
Specifies the y coordinate of the upper left hand corner of the print
window, in twips. A twip is 1/1440th of an inch or 1/20th of a point.
To specify a width of 5", for example, you would pass a value of 7200.
width
Specifies the width of the print window, in pixels.
height
Specifies the height of the print window, in pixels.
Return Value 0 if the call is successful; returns an error code if an error occurs.
PEPrintReport 16-bit
(VB Syntax) Declare Function PEPrintReport Lib "crpe.dll"
(ByVal RptName As String, ByVal Printer As
Integer, ByVal Window As Integer, ByVal Title As
String, ByVal Left As Integer, ByVal Top As
Integer, ByVal Width As Integer, ByVal Height As
Integer, ByVal Style As Long, ByVal
ParentWindow As Integer) As Integer
32-bit
Declare Function PEPrintReport Lib "crpe32.dll"
(ByVal RptName As String, ByVal Printer As
Integer, ByVal Window As Integer, ByVal Title As
String, ByVal Left As Integer, ByVal Top As
Integer, ByVal Width As Integer, ByVal Height As
Integer, ByVal style As Long, ByVal
ParentWindow As Long) As Integer
PEPrintReport 16-bit
(Delphi Syntax) function PEPrintReport (
reportFilePath: PChar;
toDefaultPrinter: Bool;
toWindow: Bool;
title: Pchar;
left: integer;
top: integer;
width; integer;
32-bit
function PEPrintReport (
reportFilePath: PChar;
toDefaultPrinter: Bool;
toWindow: Bool;
title: PChar;
left: integer;
top: integer;
width: integer;
height: integer;
style: longint;
parentWindow: HWnd
): smallint stdcall;
Prints the report displayed in the print window. This function can be
used in a custom-print link to enable the user to preview the report
in the print window, and then, if everything looks satisfactory, to
print the report to the printer (in response to a user event).
BOOL CRPE_API PEPrintWindow (
short printJob,//handle to print job
BOOL waitUntilDone
//return when printing starts? (T/F)
);
Parameter printJob
Specifies the handle to the print job you want to print to a window.
waitUntilDone
Indicates whether or not the function is to return as soon as printing
starts. Use one of the following values:
Return Value TRUE (1) if the call is successful, FALSE (0) if the call fails.
PEPrintWindow 16-bit
(VB Syntax) Declare Function PEPrintWindow Lib "crpe.dll"
(ByVal printJob As Integer, ByVal WaitNoWait As
Integer) As Integer
32-bit
Declare Function PEPrintWindow Lib "crpe32.dll"
(ByVal printJob As Integer, ByVal WaitNoWait As
Integer) As Integer
PEPrintWindow 16-bit
(Delphi Syntax) function PEPrintWindow (
printJob: integer;
waitUntilDone: Bool
):Bool;
32-bit
function PEPrintWindow (
printJob: Word;
waitUntilDone: Bool
): Bool stdcall;
Parameters printJob
Specifies the handle to the print job for which you want to select a
printer.
driverName*
Specifies a pointer to a null-terminated string that contains the name
of the printer driver for the selected printer.
printerName*
Specifies a pointer to a null-terminated string that contains the
printer name for the selected printer.
portName*
Specifies a pointer to a null-terminated string that contains the port
name for the port to which the selected printer is attached.
mode*
Specifies the pointer to the DEVMODE structure.
*The PRINTDLG structure, returned by the Windows API PrintDlg
function, contains handles to DEVMODE and DEVNAMES
structures. This information can be used to obtain driverName,
printerName, portName, and mode values for PESelectPrinter.
Return Value TRUE (1) if the call is successful, FALSE (0) if the call fails.
PESelectPrinter 16-bit
(VB Syntax) Declare Function PESelectPrinter Lib "crpe.dll"
(ByVal printJob As Integer, ByVal PrinterDriver
As String, ByVal PrinterName As String, ByVal
PortName As String, ByVal DevMode As Any) As
Integer
32-bit
Declare Function PESelectPrinter Lib
"crpe32.dll" (ByVal printJob As Integer, ByVal
PrinterDriver As String, ByVal PrinterName As
String, ByVal PortName As String, ByVal DevMode
As Any) As Integer
32-bit
function PESelectPrinter(
printJob: Word;
driverName: PChar;
printerName: PChar;
portName: PChar;
mode: PDeviceMode
): Bool stdcall;
PESetDialogParentWindow
Parameters printJob
Specifies the handle of the print job for which you want to specify a
parent window.
parentWindow
Specifies the handle of the parent window.
Return Value TRUE (1) if the call is successful, FALSE (0) if the call fails.
PESetDialogParent 16-bit
Window Declare Function PESetDialogParentWindow Lib
"crpe.dll" (ByVal printJob As Integer, ByVal
(VB Syntax) parentWindow As Long) As Integer
32-bit
Declare Function PESetDialogParentWindow Lib
"crpe32.dll" (ByVal printJob As Integer, ByVal
parentWindow As Long) As Integer
PESetDialogParent 16-bit
Window function PESetDialogParentWindow (
printJob: integer;
(Delphi Syntax) parentWindow: HWnd
): Bool;
32-bit
function PESetDialogParentWindow (
printJob: Word;
parentWindow: HWnd
): Bool stdcall;
PESetFont
Parameters printJob
Specifies the handle of the print job for which you want to select a
font.
sectionCode
Specifies the code for the report section(s) for which you want to
select a font. See Working with Section Codes, Page 428.
scopeCode
Specifies whether the font selected is to apply to fields, to text, or to
both. To specify both fields and text, use the OR operator. Select your
code from the following:
Value Meaning
PE_FIELDS Sets the default font for all field
values in the report section
specified.
PE_TEXT Sets the default font for all text
(that has not been entered as a field
value) in the report section
specified.
Value Meaning
FF_DONTCARE No change.
FF_ROMAN Variable pitch font with serifs.
FF_SWISS Fixed pitch font without serifs.
FF_MODERN Fixed-pitch font, with or without
serifs.
FF_SCRIPT Handwriting-like font.
FF_DECORATIVE Fancy display font.
fontPitch
Specifies the font pitch you wish to use. Use a constant value for the
font pitch as defined in Windows.h.
Use DEFAULT_PITCH if you wish to retain the current default.
Value Meaning
DEFAULT_PITCH 0X00
FIXED_PITCH 0X01
VARIABLE_PITCH 0X02
charSet
Specifies the character set you wish to use. Use a constant value for
the character set as defined in Windows.h. Use
DEFAULT_CHARSET if you wish to retain the current default.
Value Meaning
ANSI_CHARSET 0
DEFAULT_CHARSET 1
SYMBOL_CHARSET 2
SHIFTJIS_CHARSET 128
HANGEUL_CHARSET 129
CHINESEBIG5_CHARSET 136
OEM_CHARSET 255
Value Meaning
FW_DONTCARE 0
FW_THIN 100
FW_EXTRALIGHT 200
FW_LIGHT 300
FW_NORMAL 400
FW_MEDIUM 500
FW_SEMIBOLD 600
FW_BOLD 700
FW_EXTRABOLD 800
FW_HEAVY 900
FW_ULTRALIGHT FW_EXTRALIGHT
FW_REGULAR FW_NORMAL
FW_DEMIBOLD FW_SEMIBOLD
FW_ULTRABOLD FW_EXTRABOLD
FW_BLACK FW_HEAVY
PESetFont 16-bit
(VB Syntax) Declare Function PESetFont Lib "crpe.dll"
(ByVal printJob As Integer, ByVal sectionCode
As Integer, ByVal ScopeCode As Integer, ByVal
FaceName As String, ByVal FontFamily As
Integer, ByVal FontPitch As Integer, ByVal
CharSet As Integer, ByVal PointSize As Integer,
ByVal isItalic As Integer, ByVal isUnderlined
As Integer, ByVal isStruckOut As Integer, ByVal
Weight As Integer) As Integer
32-bit
Declare Function PESetFont Lib "crpe32.dll"
(ByVal printJob As Integer, ByVal sectionCode
As Integer, ByVal ScopeCode As Integer, ByVal
FaceName As String, ByVal FontFamily As
Integer, ByVal FontPitch As Integer, ByVal
CharSet As Integer, ByVal PointSize As Integer,
PESetFont 16-bit
(Delphi Syntax) function PESetFont (
printJob: integer;
sectionCode: integer;
scopeCode: integer;
faceName: PChar;
fontFamily: integer;
fontPitch: integer;
charSet: integer;
pointSize: integer;
isItalic: integer;
isUnderlined: integer;
isStruckOut: integer;
weight: integer
):Bool;
32-bit
function PESetFont(
printJob: Word;
sectionCode: integer;
scopeCode: integer;
faceName: PChar;
fontFamily: integer;
fontPitch: integer;
charSet: integer;
pointSize: integer;
isItalic: integer;
isUnderlined: integer;
isStruckOut: integer;
weight: integer
): Bool stdcall;
Parameters printJob
Specifies the handle of the print job for which you want to set a new
formula string.
formulaName
Specifies a pointer to the null-terminated string that contains the
name of the formula for which you want to set a new formula string.
formulaString
Specifies a pointer to the null-terminated string that you want to
replace the existing formula string.
Return Value TRUE (1) if the call is successful, FALSE (0) if the named formula
does not exist or if there is an error in the new formula.
NOTE: If the formula does not exist, the program generates a
PE_ERR_BADFORMULANAME code. If there is an error in the
formula, the program generates a PE_ERR_BADFORMULATEXT
code. Refer to Report Engine Error Codes for further information.
PESetFormula 16-bit
(VB Syntax) Declare Function PESetFormula Lib "crpe.dll"
(ByVal printJob As Integer, ByVal FormulaName
As String, ByVal FormulaString As String) As
Integer
32-bit
Declare Function PESetFormula Lib "crpe32.dll"
(ByVal printJob As Integer, ByVal FormulaName
As String, ByVal FormulaString As String) As
Integer
PESetFormula 16-bit
(Delphi Syntax) function PESetFormula (
printJob: integer;
formulaName: PChar;
formulaString: PChar
): Bool;
32-bit
function PESetFormula (
printJob: Word;
formulaName: PChar;
formulaString: PChar
): Bool stdcall;
PESetGraphData
Parameters printJob
Specifies the handle of the print job for the report containing the
graph that you are changing.
sectionCode
Specifies the code for the report section in which the graph appears.
See Working with Section Codes, Page 428.
graphN
Specifies which graph within the section you are changing. This
value is 0 indexed. Within a section, graphs are numbered from top
to bottom, first, then from left to right if they have the same top.
graphDataInfo
Specifies the pointer to the PEGraphDataInfo structure.
Return Value TRUE (1) if the call is successful, FALSE(0) if an error occurs.
PESetGraphData 16-bit
(VB Syntax) Declare Function PESetGraphData Lib "crpe.dll"
(ByVal printJob As Integer, ByVal sectionCode
As Integer, ByVal GraphN As Integer,
GraphDataInfo As PEGraphDataInfo) As Integer
32-bit
Declare Function PESetGraphData Lib
"crpe32.dll" (ByVal printJob As Integer, ByVal
sectionCode As Integer, ByVal GraphN As
Integer, GraphDataInfo As PEGraphDataInfo) As
Integer
32-bit
function PESetGraphData (
printJob: Word;
sectionCode: integer;
graphN: integer;
graphDataInfo: PEGraphDataInfo
): Bool stdcall;
PESetGraphOptions
Changes the display options set for the specified graph in the
specified section. Use this function to change any of several graph
options. These options include the minimum and maximum values
that can appear on the graph, whether grid lines appear, whether
risers are labeled, whether bar graphs have horizontal or vertical
bars, and whether a legend appears on the graph.
BOOL CRPE_API PESetGraphOptions (
short printJob,//handle to print job
short sectionCode,
//code identifying section
short graphN, //number of graph in section
struct PEGraphOptions FAR *graphOptions
//structure pointer
);
Parameters printJob
Specifies the handle of the print job for the report containing the
graph you are changing.
sectionCode
Specifies the code for the report section in which the graph appears.
See Working with Section Codes, Page 428.
Return Value TRUE (1) if the call is successful, FALSE (0) if the call fails.
PESetGraph 16-bit
Options Declare Function PESetGraphOptions Lib
"crpe.dll" (ByVal printJob As Integer, ByVal
(VB Syntax) sectionCode As Integer, ByVal GraphN As
Integer, GraphOptions As PEGraphOptions) As
Integer
32-bit
Declare Function PESetGraphOptions Lib
"crpe32.dll" (ByVal printJob As Integer, ByVal
sectionCode As Integer, ByVal GraphN As
Integer, GraphOptions As PEGraphOptions) As
Integer
PESetGraph 16-bit
Options function PESetGraphOptions (
printJob: integer;
(Delphi Syntax) sectionCode: integer;
graphN: integer;
var graphOptions: PEGraphOptions
): Bool;
32-bit
function PESetGraphOptions (
printJob: Word;
sectionCode: integer;
graphN: integer;
graphOptions: PEGraphOptions
): Bool stdcall;
Parameters printJob
Specifies the handle of the print job for the report containing the
graph that you are changing the text for.
sectionCode
Specifies the code for the report section in which the graph appears.
See Working with Section Codes, Page 428.
graphN
Specifies which graph within the section you are changing the text
for. This value is 0 indexed. Within a section, graphs are numbered
from top to bottom, first, then from left to right if they have the same
top.
graphTextInfo
Specifies the pointer to the PEGraphTextInfo structure.
Return Value TRUE (1) if the call is successful, FALSE (0) if the call fails.
PESetGraphText 16-bit
(VB Syntax) Declare Function PESetGraphText Lib "crpe.dll"
(ByVal printJob As Integer, ByVal sectionCode
As Integer, ByVal GraphN As Integer,
GraphTextInfo As PEGraphTextInfo) As Integer
32-bit
Declare Function PESetGraphText Lib
"crpe32.dll" (ByVal printJob As Integer, ByVal
sectionCode As Integer, ByVal GraphN As
Integer, GraphTextInfo As PEGraphTextInfo) As
Integer
PESetGraphText 16-bit
(Delphi Syntax) function PESetGraphText (
printJob: integer;
sectionCode: integer;
graphN: integer;
var graphTextInfo: PEGraphTextInfo
): Bool;
32-bit
function PESetGraphText (
printJob: Word;
sectionCode: integer;
graphN: integer;
graphTextInfo: PEGraphTextInfo
): Bool stdcall;
PESetGraphType
Changes the type of graph displayed for the specified graph in the
specified section based on one of the available graph/chart types.
Use this function to change the type of graph that is displayed in the
report. There are many types of graphs and charts possible with
Crystal Reports. This function allows you to change which type of
graph or chart is being displayed.
Parameters printJob
Specifies the handle of the print job for the report containing the
graph for which you want to change the type.
sectionCode
Specifies the code for the report section in which the graph appears.
See Working with Section Codes, Page 428.
graphN
Specifies which graph within the section for which you want to
change the type. This value is 0 indexed. Within a section, graphs are
numbered from top to bottom, first, then from left to right if they
have the same top.
graphType
Specifies a pointer to the type of graph you want to be displayed. For a list
of possible graph types, refer to the chart under PEGetGraphType.
Return Value TRUE (1) if the call is successful, FALSE (0) if the call fails.
PESetGraphType 16-bit
(VB Syntax) Declare Function PESetGraphType Lib "crpe.dll"
(ByVal printJob As Integer, ByVal sectionCode
As Integer, ByVal GraphN As Integer, GraphType
As Integer) As Integer
PESetGraphType 16-bit
(Delphi Syntax) function PESetGraphType (
printJob: integer;
sectionCode: integer;
graphN: integer;
var graphType: integer
): Bool;
32-bit
function PESetGraphType (
printJob: Word;
sectionCode: integer;
graphN: integer;
graphType: integer
): Bool stdcall;
PESetGroupCondition
Value Meaning
PE_GC_DAILY Triggers a grouping every time
the date changes.
PE_GC_WEEKLY Triggers a grouping every time
the date changes from one week
to the next. (A week runs from
Sunday through Saturday.)
PE_GC_BIWEEKLY Triggers a grouping every time
the date changes from one two-
week period to the next. (Weeks
run from Sunday through
Saturday.)
PE_GC_SEMIMONTHLY Triggers a grouping every time
the date changes from one half-
month period to the next.
PE_GC_MONTHLY Triggers a grouping every time
the date changes from one month
to the next.
PE_GC_QUARTERLY Triggers a grouping every time
the date changes from one
calendar quarter to the next.
sortDirection
Specifies one of the following sort directions:
Value Meaning
PE_SF_ASCENDING Sorts data in ascending order (A to
Z, 1 to 9).
PE_SF_DESCENDING Sorts data in descending order (Z to
A, 9 to 1).
Return Value TRUE (1) if the call is successful, FALSE (0) if the call fails.
Remarks No default values are allowed. You must specify all three parameters
when you use this function.
PESetGroup 16-bit
Condition Declare Function PESetGroupCondition Lib
"crpe.dll" (ByVal printJob As Integer, ByVal
(VB Syntax) sectionCode As Integer, ByVal ConditionField As
String, ByVal Condition As Integer, ByVal
SortDirection As Integer) As Integer
32-bit
Declare Function PESetGroupCondition Lib
"crpe32.dll" (ByVal printJob As Integer, ByVal
sectionCode As Integer, ByVal ConditionField As
String, ByVal Condition As Integer, ByVal
SortDirection As Integer) As Integer
PESetGroup 16-bit
Condition function PESetGroupCondition (
printJob: integer;
(Delphi Syntax) sectionCode: integer;
conditionField: PChar;
condition: integer;
sortDirection: integer
): Bool;
32-bit
function PESetGroupCondition (
printJob: Word;
sectionCode: integer;
conditionField: PChar;
condition: integer;
sortDirection: integer
): Bool stdcall;
PESetGroupSelectionFormula
Parameters printJob
Specifies the handle of the print job from which you want to set a
new group selection formula.
formulaString
Specifies a pointer to the null-terminated string you want to assign
to the group selection formula.
Return Value TRUE (1) if the call is successful, FALSE (0) if the call fails or if there
is an error in the new formula.
NOTE: If there is an error in the formula, the program generates a
PE_ERR_BADFORMULATEXT code. For information on this code,
see Report Engine Error Codes.
NOTE: A group sort field is a summary value or a summarized field
that determines the sort order of groups.
PESetGroup 16-bit
SelectionFormula Declare Function PESetGroupSelectionFormula
Lib "crpe.dll" (ByVal printJob As Integer,
(VB Syntax) ByVal FormulaString As String) As Integer
32-bit
Declare Function PESetGroupSelectionFormula
Lib "crpe32.dll" (ByVal printJob As Integer,
ByVal FormulaString As String) As Integer
PESetGroup 16-bit
SelectionFormula function PESetGroupSelectionFormula (
printJob: integer;
(Delphi Syntax) formulaString: PChar
): Bool;
32-bit
function PESetGroupSelectionFormula (
printJob: Word;
formulaString: PChar
): Bool stdcall;
PESetMargins
Parameters printJob
Specifies the handle of the print job for which you want to set new
margins.
left
Specifies the left margin.*
right
Specifies the right margin.*
top
Specifies the top margin.*
bottom
Specifies the bottom margin.*
Value Meaning
PM_SM_DEFAULT You can use PM_SM_DEFAULT for
any of the margin parameters. For
each margin you specify in this way,
the program will use the appropriate
default margin for the currently
selected printer.
*Left, right, top, and bottom values are all in twips. A twip is 1/1440
of an inch; there are 20 twips in a point. To set .5" margins, for
example, you would enter the value 720.
Return Value TRUE (1) if the call is successful, FALSE (0) if the call fails.
PESetMargins 16-bit
(VB Syntax) Declare Function PESetMargins Lib "crpe.dll"
(ByVal printJob As Integer, ByVal LeftMargin As
Integer, ByVal RightMargin As Integer, ByVal
TopMargin As Integer, ByVal BottomMargin As
Integer) As Integer
32-bit
Declare Function PESetMargins Lib "crpe32.dll"
(ByVal printJob As Integer, ByVal LeftMargin As
Integer, ByVal RightMargin As Integer, ByVal
TopMargin As Integer, ByVal BottomMargin As
Integer) As Integer
PESetMargins 16-bit
(Delphi Syntax) function PESetMargins (
printJob: integer;
left: Word;
right: Word;
top: Word;
bottom: Word
):Bool;
32-bit
function PESetMargins (
printJob: Word;
left: integer;
right: integer;
top: integer;
bottom: integer
): Bool stdcall;
Parameters printJob
Specifies the handle to the print job for which you want to set the
minimum section height.
sectionCode
Specifies the code for the report section(s) for which you want to set
minimum section height. See Working with Section Codes, Page 428.
minimumHeight
Specifies the minimum section height (in twips) for the section(s)
selected. A twip is 1/1440 inch - there are 20 twips to a point.
Return Value TRUE (1) if the call is successful, FALSE (0) if the call fails.
PESetMinimum 16-bit
SectionHeight Declare Function PESetMinimumSectionHeight Lib
"crpe.dll" (ByVal printJob As Integer, ByVal
(VB Syntax) sectionCode As Integer, ByVal MinimumHeight As
Integer) As Integer
PESetMinimum 16-bit
SectionHeight function PESetMinimumSectionHeight (
printJob: integer;
(Delphi Syntax) sectionCode: integer;
minimumHeight: integer
):Bool;
32-bit
function PESetMinimumSectionHeight (
printJob: Word;
sectionCode: integer;
minimumHeight: integer
): Bool stdcall;
PESetNDetailCopies
Return Value TRUE (1) if the call is successful, FALSE (0) if the call fails.
PESetNDetail 16-bit
Copies (VB Syntax) Declare Function PESetNDetailCopies Lib
"crpe.dll" (ByVal printJob As Integer, ByVal
nDetailCopies As Integer) As Integer
32-bit
Declare Function PESetNDetailCopies Lib
"crpe32.dll" (ByVal printJob As Integer, ByVal
nDetailCopies As Integer) As Integer
PESetNDetail 16-bit
Copies function PESetNDetailCopies (
printJob: integer;
(Delphi Syntax) nCopies: integer
):Bool;
32-bit
function PESetNDetailCopies(
printJob: Word;
nCopies: integer;
): Bool stdcall;
Sets one of the group sort fields in the specified report. This function
can be used by itself to set a sort field/direction when there is not one
already set, or to modify an existing sort field/ direction when the
sort field number, name, and direction are known.
The function can also be used as one of a series of functions:
PEGetNGroupSortFields (called once), PEGetNthGroupSortField/
PEGetHandleString (called as many times as needed to identify the
correct group sort field), and PESetNthGroupSortField (called once,
when the correct group sort field is identified). The series can be used
in a custom-print link to identify and then change an existing group
sort field and/or sort order at print time in response to a user
selection.
When you give the user the ability to specify group sort field(s) and/
or direction at print time, your link must include code to replace
name, and/or direction with user-generated values.
BOOL CRPE_API PESetNthGroupSortField (
short printJob,//handle to print job
short sortFieldN,//number of sort field
char FAR *name,
//pointer to group sort field name
short direction//sort direction setting
);
Parameters printJob
Specifies the handle to the print job for which you want to set a group
sort field.
sortFieldN
Specifies the number of the sort field you want to set. The first sort
field is field 0. If the report has N sort fields, the function can be
called with sortFieldN between 0 and N-1. If the report has N sort
fields, you can call the function with sortFieldN = N to add a new
sort field to the end of the list of existing sort fields. If N=0, the
function will add the first sort field.
name
Specifies a pointer to the null-terminated string that contains the
name of the group sort field.
Value Meaning
PE_SF_ASCENDING Sorts in Ascending order (A to Z, 1
to 9).
PE_SF_DESCENDING Sorts in Descending order (Z to A,
9 to 1).
Return Value TRUE (1) if the call is successful, FALSE (0) if the call fails.
PESetNthGroup 16-bit
SortField Declare Function PESetNthGroupSortField Lib
"CRPE.DLL" (ByVal printJob As Integer, ByVal
(VB Syntax) sortFieldN As Integer, ByVal name As String,
ByVal direction As Integer) As Integer
32-bit
Declare Function PESetNthGroupSortField Lib
"crpe32.dll" (ByVal printJob As Integer, ByVal
SortFieldN As Integer, ByVal SortGroupName As
String, ByVal Direction As Integer) As Integer
PESetNthGroup 16-bit
SortField function PESetNthGroupSortField (
printJob: integer;
(Delphi Syntax) sortFieldN: integer;
name: PChar;
direction: integer
):Bool;
PESetNthParam
Parameters printJob
Specifies the handle of the print job that contains the stored
procedure which you want to set the value of a parameter.
paramN
0 indexed parameter number, indicates which parameter you want
to set the value for.
szParamValue
String representation of the value you are assigning to the parameter.
Return Value TRUE (1) if the call is successful, FALSE (0) if the call fails.
PESetNthParam 16-bit
(VB Syntax) Declare Function PESetNthParam Lib "crpe.dll"
(ByVal printJob As Integer, ByVal ParamN As
Integer, ByVal ParamValue As String) As Integer
32-bit
Declare Function PESetNthParam Lib "crpe32.dll"
(ByVal printJob As Integer, ByVal paramN As
Integer, ByVal ParamValue As String) As Integer
PESetNthParam 16-bit
(Delphi Syntax) function PESetNthParam(
printJob: integer;
paramN: integer;
szParamValue: PChar
): Bool;
32-bit
function PESetNthParam(
printJob: Word;
paramN: integer;
szParamValue: PChar
): Bool stdcall;
PESetNthParameterField
Parameters printJob
Specifies the handle of the print job for which you want to set a
parameter field value.
parameterN
Specifies the number of the parameter field in the report.
parameterInfo
Specifies a pointer to the structure used to pass the parameter field
value information.
Return value TRUE (1) if the call is successful, FALSE (0) if the call fails.
PESetNth 16-bit
ParameterField Declare Function PESetNthParameterField Lib
"crpe.dll" (ByVal printJob As Integer, ByVal
(VB Syntax) varN As Integer, varInfo As
PEParameterFieldInfo) As Integer
PESetNth 16-bit
ParameterField function PESetNthParameterField (
printJob: integer;
(Delphi Syntax) varN: integer;
var varInfo: PEParameterFieldInfo
): Bool;
32-bit
function PESetNthParameterField (
printJob: Word;
varN: Smallint;
var varInfo: PEParameterFieldInfo
): Bool stdcall;
PESetNthSortField
Sets one of the sort fields in the specified report. This function can be
used by itself to set a sort field/direction when there is not one
already set, or to change a sort field/direction when the number and
name of the sort field are known.
The function can also be used as one of a series of functions: PEGet-
NSortFields (called once), PEGetNthSortField/PEGetHandleString
(called together as many times as needed to identify the correct sort
field), and PESetNthSortField (called once when the correct sort field
is identified). The series can be used in a custom-print link to identify
and then change an existing sort field and/or sort order at print time
in response to a user selection.
When you give the user the ability to specify sort field(s) and/or
direction at print time, your link must include code to replace name,
and/or direction with user-generated values.
BOOL CRPE_API PESetNthSortField (
short printJob,//handle to print job
short sortFieldN,//number of sort field
char FAR *name,//pointer to sort field name
short direction//sort direction setting
);
Value Meaning
PE_SF_ASCENDING Sorts in Ascending order (A to Z, 1 to
9).
PE_SF_DESCENDING Sorts in Descending order (Z to A, 9
to 1).
Return Value TRUE (1) if the call is successful, FALSE (0) if the call fails.
PESetNthSortField 16-bit
(VB Syntax) Declare Function PESetNthSortField Lib
"crpe.dll" (ByVal printJob As Integer, ByVal
SortNumber As Integer, ByVal SortFieldName As
String, ByVal Direction As Integer) As Integer
PESetNthSortField 16-bit
(Delphi Syntax) function PESetNthSortField (
printJob: integer;
sortFieldN: integer;
name: PChar;
direction: integer
):Bool;
32-bit
function PESetNthSortField (
printJob: Word;
sortFieldN: integer;
name: PChar;
direction: integer
): Bool stdcall;
PESetNthTableLocation
Return Value TRUE (1) if the call is successful; FALSE (0) if the call fails.
PESetNthTable 16-bit
Location Declare Function PESetNthTableLocation Lib
"crpe.dll" (ByVal printJob As Integer, ByVal
(VB Syntax) TableN As Integer, Location As PETableLocation)
As Integer
32-bit
Declare Function PESetNthTableLocation Lib
"crpe32.dll" (ByVal printJob As Integer, ByVal
TableN As Integer, Location As PETableLocation)
As Integer
PESetNthTable 16-bit
Location function PESetNthTableLocation (
printJob: integer;
(Delphi Syntax) tableN: integer;
var location: PETableLocation
):Bool;
PESetNthTableLogOnInfo
Parameters printJob
Specifies the handle of the print job for which you want to set table
log on information.
tableN
Specifies the number of the table for which you want to set log on
information. The first table is table 0. The last table is N-1.
logOnInfo
Specifies the pointer to the PELogOnInfo structure.
propagateAcrossTables
Indicates whether or not the program should apply the new log on
information to any other tables in the report that had the same
original server and database names as the specified table. You may
use either of the following values:
Value Meaning
TRUE Program will apply log on
information to all other tables that
have the same original server and
database names.
Return Value TRUE (1) if the call is successful, FALSE (0) if the call fails.
PESetNthTable 16-bit
LogOnInfo Declare Function PESetNthTableLogOnInfo Lib
"crpe.dll" (ByVal printJob As Integer, ByVal
(VB Syntax) TableN As Integer, LogOnInfo As PELogOnInfo,
ByVal Propagate As Integer) As Integer
32-bit
Declare Function PESetNthTableLogOnInfo Lib
"crpe32.dll" (ByVal printJob As Integer, ByVal
TableN As Integer, LogOnInfo As PELogOnInfo,
ByVal Propagate As Integer) As Integer
32-bit
function PESetNthTableLogOnInfo (
printJob: Word;
tableN: integer;
var logOnInfo: PELogOnInfo;
propagateAcrossTables: Bool
): Bool stdcall;
PESetNthTableSessionInfo
Parameters printJob
Specifies the handle of the print job for which you want to change the
MS Access session information.
tableN
0 based table number specifying which table the session is being
opened for.
sessionInfo
Refer to the PESessionInfo structure for further information.
Return Value TRUE (1) if the call is successful, FALSE (0) if the call fails.
PESetNthTable 16-bit
SessionInfo Declare Function PESetNthTableSessionInfo Lib
"crpe.dll" (ByVal printJob As Integer, ByVal
(VB Syntax) TableN As Integer, SessionInfo As
PESessionInfo, ByVal PropagateAcrossTables As
Integer) As Integer
32-bit
Declare Function PESetNthTableSessionInfo Lib
"crpe32.dll" (ByVal printJob As Integer, ByVal
TableN As Integer, SessionInfo As
PESessionInfo, ByVal PropagateAcrossTables As
Integer) As Integer
PESetNthTable 16-bit
SessionInfo function PESetNthTableSessionInfo (
printJob: integer;
(Delphi Syntax) tableN: integer;
var sessionInfo: PESessionInfo;
propagateAcrossTables: Bool
):Bool;
32-bit
function PESetNthTableSessionInfo (
printJob: Word;
tableN: integer;
var sessionInfo: PESessionInfo;
propagateAcrossTables: Bool
): Bool stdcall;
Sets a print date that may be different than the system calendar date.
Use this function any time you want to show a print date (or use a
print date in formulas) other than the actual date of printing.
BOOL CRPE_API PESetPrintDate (
short printJob,//handle to print job
short year, //print date year component
short month,//print date month component
short day //print date day component
);
Parameters printJob
Specifies the handle of the print job for which you want to set the
print date.
year
Specifies the year component of the print date. Enter a 4 digit year
value (1994, 1993, etc.).
month
Specifies the month component of the print date. Months are
numbered from 1 to 12, where January = 1 and December = 12. To use
July as the print month, for example, you would enter the value 7.
day
Specifies the day component of the print date. Enter the actual day of
the month you want to use (7, 18, 28, etc.).
Return Value TRUE (1) if the call is successful, FALSE (0) if the call fails.
Remarks You change the print date, typically, when you want to run the
report today yet have it appear to have been run on a different date.
An example would be, if you were out of town on the last day of the
previous month and you later want to run a report for that month
and make it appear as if it were run on the last day of the month.
PESetPrintDate 16-bit
(VB Syntax) Declare Function PESetPrintDate Lib "crpe.dll"
(ByVal printJob As Integer, ByVal Date_Year As
Integer, ByVal Date_Month As Integer, ByVal
Date_Day As Integer) As Integer
32-bit
Declare Function PESetPrintDate Lib
"crpe32.dll" (ByVal printJob As Integer, ByVal
Date_Year As Integer, ByVal Date_Month As
Integer, ByVal Date_Day As Integer) As Integer
PESetPrintDate 16-bit
(Delphi Syntax) function PESetPrintDate (
printJob: integer;
year: integer;
month: integer;
day: integer
):Bool;
32-bit
function PESetPrintDate (
printJob: Word;
year: integer;
month: integer;
day: integer
): Bool stdcall;
Parameters printJob
Specifies the handle of the print job for which you want to set
printing options.
options
Specifies the pointer to the PEPrintOptions structure. NOTE: If this
parameter is set to 0 (null), the function prompts the user for these
options. Using this, you can get the behavior of the print-to-printer
button in the print window by calling PESetPrintOptions with a null
pointer and then calling PEPrintWindow.
Return Value TRUE (1) if the call is successful, FALSE (0) if the call fails.
PESetPrintOptions 16-bit
(VB Syntax) Declare Function PESetPrintOptions Lib
"crpe.dll" (ByVal printJob As Integer, Options
As PEPrintOptions) As Integer
PESetPrintOptions 16-bit
(Delphi Syntax) function PESetPrintOptions (
printJob: integer;
var options: PEPrintOptions
): Bool;
32-bit
function PESetPrintOptions (
printJob: Word;
var options: PEPrintOptions
): Bool stdcall;
PESetReportTitle
Parameters printJob
Specifies the handle of the print job for which you want to set the
report title.
title
Specifies a null-terminated string containing the new title you want
to assign to the report.
Remarks When you give the user the ability to change the report title at print
time, your link must include code to replace texturing with a user-
generated value.
PESetReportTitle 16-bit
(VB Syntax) Declare Function PESetReportTitle Lib
"crpe.dll" (ByVal printJob As Integer, ByVal
Title As String) As Integer
32-bit
Declare Function PESetReportTitle Lib
"crpe32.dll" (ByVal printJob As Integer, ByVal
Title As String) As Integer
PESetReportTitle 16-bit
(Delphi Syntax) function PESetReportTitle (
printJob: integer;
title: PChar
):Bool;
32-bit
function PESetReportTitle (
printJob: Word;
title: PChar
): Bool stdcall;
Parameters printJob
Specifies the handle of the print job for which you want to set section
formatting options.
sectionCode
Specifies the code for the report section(s) for which you want to set
formatting options. See Working with Section Codes, Page 428.
options
Specifies the pointer to the PESectionOptions structure. You use this
structure to set your section options.
*There can be multiple group header and group footer sections in a
given report. When you have multiple group sections, the first group
header section is designated 3000, the second is designated 3001, etc.
Likewise, the first group footer section is designated 5000, the second
is designated 5001, etc.
**There can be multiple Detail sections in a given report. When you
have multiple Detail sections, the first Detail section is designated
4000, the second is designated 4001, etc.
Return Value TRUE (1) if the call is successful, FALSE (0) if the call fails.
PESetSection 16-bit
Format Declare Function PESetSectionFormat Lib
"crpe.dll" (ByVal printJob As Integer, ByVal
(VB Syntax) sectionCode As Integer, Options As
PESectionOptions) As Integer
32-bit
Declare Function PESetSectionFormat Lib
"crpe32.dll" (ByVal printJob As Integer, ByVal
sectionCode As Integer, Options As
PESectionOptions) As Integer
PESetSection 16-bit
Format function PESetSectionFormat (
printJob: integer;
(Delphi Syntax) sectionCode: integer;
var options: PESectionOptions
): Bool;
32-bit
function PESetSectionFormat (
printJob: Word;
sectionCode: integer;
var options: PESectionOptions
): Bool stdcall;
PESetSectionFormatFormula
Parameters printJob
Specifies the handle of the print job for which you want to set a new
selection formula string.
sectionCode
Specifies the code for the report section(s) for which you want to set
formatting options. See Working with Section Codes, Page 428.
formulaName
Specifies the name of the formula for which you want to supply a
new string. Use one of the following constants:
Return Value TRUE (1) if the call is successful, FALSE (0) if the call fails or if there
is an error in the new formula.
NOTE: If the formula does not exist, the program generates a
PE_ERR_BADFORMULANAME code. If there is an error in the
formula, the program generates a PE_ERR_BADFORMULATEXT
code. Refer to Report Engine Error Codes for further information.
PESetSection 16-bit
FormatFormula Declare Function PESetSectionFormatFormula Lib
"crpe.dll" (ByVal printJob As Integer, ByVal
(VB Syntax) sectionCode As Integer, ByVal formulaName As
Integer, ByVal FormulaString As String) As
Integer
32-bit
Declare Function PESetSectionFormatFormula Lib
"crpe32.dll" (ByVal printJob As Integer, ByVal
sectionCode As Integer, ByVal formulaName As
Integer, ByVal FormulaString As String) As
Integer
PESetSelection 16-bit
Formula function PESetSectionFormatFormula (
printJob: integer;
(Delphi Syntax) sectionCode: integer;
formulaName: integer;
formulaString: integer
):Bool;
32-bit
function PESetSectionFormatFormula (
printJob: Word;
sectionCode: integer;
formulaName: integer;
formulaString: integer
):Bool stdcall;
PESetSelectionFormula
Parameters printJob
Specifies the handle of the print job for which you want to set a new
selection formula string.
formulaString
Specifies a pointer to the null-terminated string that you want to
assign to the selection formula.
Return Value TRUE (1) if the call is successful, FALSE (0) if the call fails or if there
is an error in the new formula.
NOTE: If there is an error in the formula, the program generates a
PE_ERR_BADFORMULATEXT code. Refer to Report Engine Error
Codes for further information.
PESetSelection 16-bit
Formula Declare Function PESetSelectionFormula Lib
"crpe.dll" (ByVal printJob As Integer, ByVal
(VB Syntax) FormulaString As String) As Integer
32-bit
Declare Function PESetSelectionFormula Lib
"crpe32.dll" (ByVal printJob As Integer, ByVal
FormulaString As String) As Integer
32-bit
function PESetSelectionFormula (
printJob: Word;
formulaString: PChar
): Bool stdcall;
PESetSQLQuery
Parameters printJob
Specifies the handle to the print job for which you want to modify the
SQL query.
queryString
Specifies a pointer to the null-terminated string that you want to use
to replace the existing SQL query.
Remarks This function is mostly useful for reports with SQL queries that were
explicitly edited in the Show SQL Query dialog box in Crystal
Reports, i.e., those reports that needed database-specific selection
criteria or joins. Otherwise it is usually best to continue using
function calls such as PESetSelectionFormula and let Crystal Reports
build the SQL query automatically.
PESetSQLQuery has the same restrictions as editing in the Show SQL
Query dialog box. In particular, changes are accepted in the FROM,
WHERE, and ORDER BY clauses but they are ignored in the SELECT
list of fields.
NOTE: This call only applies to reports created against an ODBC
source or on a native SQL database connection.
PESetSQLQuery 16-bit
(VB Syntax) Declare Function PESetSQLQuery Lib "crpe.dll"
(ByVal printJob As Integer, ByVal QueryString
As String) As Integer
32-bit
Declare Function PESetSQLQuery Lib "crpe32.dll"
(ByVal printJob As Integer, ByVal QueryString
As String) As Integer
NOTE: If you are going to include an ORDER BY clause, you must
precede it with CHR(13) and CHR(10).
PESetSQLQuery 16-bit
(Delphi Syntax) function PESetSQLQuery (
printJob: integer;
queryString: PChar
):Bool;
PEShow Functions
Parameters printJob
Specifies the handle for the print job for which you want to indicate
the page to be displayed.
32-bit
Declare Function PEShowFirstPage Lib
"crpe32.dll" (ByVal printJob As Integer) As
Integer
Declare Function PEShowLastPage Lib
"crpe32.dll" (ByVal printJob As Integer) As
Integer
Declare Function PEShowNextPage Lib
"crpe32.dll" (ByVal printJob As Integer) As
Integer
Declare Function PEShowPreviousPage Lib
"crpe32.dll" (ByVal printJob As Integer) As
Integer
32-bit
function PEShowFirstPage (
printJob: Word
): Bool stdcall;
function PEShowLastPage (
printJob: Word
): Bool stdcall;
function PEShowNextPage (
printJob: Word
): Bool stdcall;
function PEShowPreviousPage (
printJob: Word
): Bool stdcall;
PEShowNthPage
Parameters printJob
Specifies the handle to the print job from which you want to display
a page.
Return value TRUE (1) if the call is successful, FALSE(0) if an error occurs.
PEShowNthPage 16-bit
(VB Syntax) Declare Function PEShowNthPage Lib "crpe.dll"
(ByVal printJob As Integer, ByVal pageN As
Integer) As Integer
32-bit
Declare Function PEShowNthPage Lib "crpe32.dll"
(ByVal printJob As Integer, ByVal pageN As
Integer) As Integer
PEShowNthPage 16-bit
(Delphi Syntax) function PEShowNthPage (
printJob: integer;
pageN: integer
): Bool;
32-bit
function PEShowNthPage (
printJob: Word;
pageN: Smallint
): Bool stdcall;
Parameters printJob
Specifies the handle to the print job for which you want to display
print controls.
showPrintControls
Indicates whether or not the function is to display print controls. You
may use either of the following values:
Value Meaning
TRUE The function displays the print
controls.
FALSE The function hides the print controls.
Return Value TRUE (1) if the call is successful, FALSE (0) if the call fails.
Remarks Print controls are displayed by default. It is not necessary to use this
function simply to display controls but only if you want the user to
control whether or not the controls are visible.
PEShowPrint 16-bit
Controls Declare Function PEShowPrintControls Lib
"crpe.dll" (ByVal printJob As Integer, ByVal
(VB Syntax) ShowPrintControls As Integer) As Integer
32-bit
Declare Function PEShowPrintControls Lib
"crpe32.dll" (ByVal printJob As Integer, ByVal
ShowPrintControls As Integer) As Integer
PEShowPrint 16-bit
Controls function PEShowPrintControls (
printJob: integer;
(Delphi Syntax) showPrintControls: Bool
):Bool;
32-bit
function PEShowPrintControls(
printJob: Word;
showPrintControls: Bool
): Bool stdcall;
PEStartPrintJob
Value Meaning
TRUE The function returns when printing
is finished. In version 1.1 and higher
of CRPE, "waitUntilDone" must be
true.
FALSE The function returns as soon as
printing starts.
Return Value TRUE (1) if the call is successful, FALSE (0) if the call fails.
Remarks A print job can be started only once. Once started, the only function
that can be used is PEClosePrintJob.
PEStartPrintJob 16-bit
(VB Syntax) Declare Function PEStartPrintJob Lib "crpe.dll"
(ByVal printJob As Integer, ByVal WaitOrNot As
Integer) As Integer
32-bit
Declare Function PEStartPrintJob Lib
"crpe32.dll" (ByVal printJob As Integer, ByVal
WaitOrNot As Integer) As Integer
PEStartPrintJob 16-bit
(Delphi Syntax) function PEStartPrintJob (
printJob: integer;
waitUntilDone: Bool
):Bool;
PETestNthTableConnectivity
Parameters printJob
Specifies the handle of the print job for which you want to test a
table’s connection settings.
tableN
Specifies the number of the table for which you want to test the
connection settings.
Return Value TRUE (1) if the database session, log on, and location info is all
correct, FALSE (0) if something is wrong.
PETestNthTable 16-bit
Connectivity Declare Function PETestNthTableConnectivity
Lib "crpe.dll" (ByVal printJob As Integer,
(VB Syntax) ByVal TableN As Integer) As Integer
32-bit
Declare Function PETestNthTableConnectivity
Lib "crpe32.dll" P (ByVal printJob As Integer,
ByVal TableN As Integer) As Integer
PETestNthTable 16-bit
Connectivity function PETestNthTableConnectivity (
printJob: integer;
(Delphi Syntax) tableN: integer
):Bool;
32-bit
function PETestNthTableConnectivity (
printJob: Word;
tableN: integer
): Bool stdcall;
PEZoomPreviewWindow
Parameters printJob
The handle of the print job for which you wish to set the zoom level
of the print window.
level
The zoom level you wish to set the print window at. This value can
be one of the following constants:
Return Value TRUE (1) if the call is successful, FALSE (0) if the call fails.
PEZoomPreview 16-bit
Window Declare Function PEZoomPreviewWindow Lib
"crpe.dll" (ByVal printJob As Integer, ByVal
(VB Syntax) ZoomLevel As Integer) As Integer
32-bit
Declare Function PEZoomPreviewWindow Lib
"crpe32.dll" (ByVal printJob As Integer, ByVal
ZoomLevel As Integer) As Integer
PEZoomPreview 16-bit
Window function PEZoomPreviewWindow (
printJob: integer;
(Delphi Syntax) level: integer
):Bool
32-bit
function PEZoomPreviewWindow (
printJob: Word;
level: Smallint
): Bool stdcall;
DEVMODE
16-bit
struct tagDEVMODE
{
char dmDeviceName[CCHDEVICENAME];
UINT dmSpecVersion;
UINT dmDriverVersion;
UINT dmSize;
UINT dmDriverExtra;
DWORD dmFields;
int dmOrientation;
int dmPaperSize;
int dmPaperLength;
int dmPaperWidth;
int dmScale;
int dmCopies;
int dmDefaultSource;
int dmPrintQuality;
int dmColor;
int dmDuplex;
int dmYResolution;
int dmTTOption;
};
NOTE: This version of the DEVMODE structure was obtained from
Windows 95 SDK.
DM_ORIENTATION 0x0000001L
DM_PAPERSIZE 0x0000002L
DM_PAPERLENGTH 0x0000004L
DM_PAPERWIDTH 0x0000008L
DM_SCALE 0x0000010L
DM_COPIES 0x0000100L
DM_DEFAULTSOURCE 0x0000200L
DM_PRINTQUALITY 0x0000400L
DM_COLOR 0x0000800L
DM_DUPLEX 0x0001000L
DM_YRESOLUTION 0x0002000L
DM_TTOPTION 0x0004000L
Constant Description
DMPAPER_FIRST
DMPAPER_LETTER
DMPAPER_LETTER Letter, 8 1/2 x 11 in.
DMPAPER_LETTERSMALL Letter Small, 8 1/2 x
11 in.
DMPAPER_TABLOID Tabloid, 11 x 17 in.
DMPAPER_LEDGER Ledger, 17 x 11 in.
DMPAPER_LEGAL Legal, 8 1/2 x 14 in.
DMPAPER_STATEMENT Statement, 5 1/2 x 8
1/2 in.
DMPAPER_EXECUTIVE Executive, 7 1/2 x 10
1/2 in.
DMPAPER_A3 A3, 297 x 420 mm
DMPAPER_A4 A4, 210 x 297 mm
DMPAPER_A4SMALL A4 Small, 210 x 297
mm
DMPAPER_A5 A5, 148 x 210 mm
DMPAPER_B4 B4, 250 x 354 mm
DMPAPER_B5 B5, 182 x 257 mm
DMPAPER_FOLIO Folio, 8 1/2 x 13 in.
DMPAPER_QUARTO Quarto, 215 x 275
mm
DMPAPER_10X14 10 x 14 in.
DMPAPER_11X17 11 x 17 in.
DMPAPER_NOTE Note, 8 1/2 x 11 in.
DMBIN_AUTO
DMBIN_LOWER
DMBIN_CASSETTE
Constant Value
DMRES_HIGH (-4)
DMRES_MEDIUM (-3)
DMRES_LOW (-2)
DMRES_DRAFT (-1)
Constant Value
DMCOLOR_COLOR (1)
DMCOLOR_MONOCH (2)
ROME
DMDUP_SIMPLEX (1)
DMDUP_HORIZONTAL (2)
DMDUP_VERTICAL (3)
dmYResolution
Specifies the y-resolution of the printer, in dots per inch. If the printer
initializes this member, the dmPrintQuality member specifies the x-
resolution of the printer, in dots per inch.
dmTTOption
Specifies how TrueType fonts should be printed. It can be one of the
following values:
Remarks ● Only drivers that are fully updated for Windows versions 3.0 and
later and that export the ExtDeviceMode function use the
DEVMODE structure.
● An application can retrieve the paper sizes and names supported
by a printer by calling the DeviceCapabilities function with the
DC_PAPERS, DC_PAPERSIZE, and DC_PAPERNAMES values.
● Before setting the value of the dmTTOption member, applications
should find out how a printer driver can use TrueType fonts by
calling the DeviceCapabilities function with the DC_TRUETYPE
value.
● Drivers can add device-specific data immediately following the
DEVMODE structure.
DM_ORIENTATION 0x0000001L
DM_PAPERSIZE 0x0000002L
DM_PAPERLENGTH 0x0000004L
DM_PAPERWIDTH 0x0000008L
DM_SCALE 0x0000010L
DM_COPIES 0x0000100L
DM_DEFAULTSOURCE 0x0000200L
DM_PRINTQUALITY 0x0000400L
DM_COLOR 0x0000800L
DM_DUPLEX 0x0001000L
DM_YRESOLUTION 0x0002000L
DM_TTOPTION 0x0004000L
DMPAPER_FIRST
DMPAPER_LETTER
DMPAPER_LETTER Letter, 8 1/2 x 11 in.
DMPAPER_LETTERSMALL Letter Small, 8 1/2 x
11 in.
DMPAPER_TABLOID Tabloid, 11 x 17 in.
DMPAPER_LEDGER Ledger, 17 x 11 in.
DMPAPER_LEGAL Legal, 8 1/2 x 14 in.
DMPAPER_STATEMENT Statement, 5 1/2 x 8
1/2 in.
DMPAPER_EXECUTIVE Executive, 7 1/2 x
10 1/2 in.
DMPAPER_A3 A3, 297 x 420 mm
DMPAPER_A4 A4, 210 x 297 mm
DMPAPER_A4SMALL A4 Small, 210 x 297
mm
DMPAPER_A5 A5, 148 x 210 mm
DMPAPER_B4 B4, 250 x 354 mm
DMPAPER_B5 B5, 182 x 257 mm
DMPAPER_FOLIO Folio, 8 1/2 x 13 in.
DMPAPER_QUARTO Quarto, 215 x 275
mm
DMPAPER_10X14 10 x 14 in.
DMPAPER_11X17 11 x 17 in.
DMPAPER_NOTE Note, 8 1/2 x 11 in.
DMPAPER_ENV_9 Envelope #9, 3 7/8 x
8 7/8 in.
DMPAPER_ENV_10 Envelope #10, 4 1/8
x 9 1/2 in.
DMBIN_AUTO
DMBIN_LOWER
DMBIN_CASSETTE
DMBIN_MANUAL
DMBIN_ENVELOPE
DMBIN_MIDDLE
DMBIN_ENVMANUAL
Constant Value
DMRES_DRAFT (-1)
DMRES_LOW (-2)
DMRES_MEDIUM (-3)
DMRES_HIGH (-4)
Constant Value
DMCOLOR_COLOR (1)
DMCOLOR_MONOCH (2)
ROME
dmDuplex
Specifies duplex (double-sided) printing for printers capable of
duplex printing. This member can be one of the following values:
dmYResolution
Specifies the y-resolution of the printer, in dots per inch. If the printer
initializes this member, the dmPrintQuality member specifies the x-
resolution of the printer, in dots per inch.
dmTTOption
Specifies how TrueType fonts should be printed. It can be one of the
following values:
Constant Description
DMTT_BITMAP Print TrueType fonts as graphics.
This is the default action for dot-
matrix printers.
DMTT_DOWNLOAD Download TrueType fonts as soft
fonts. This is the default action for
Hewlett-Packard printers that use
Printer Control Language (PCL).
DMTT_SUBDEV Substitute device fonts for TrueType
fonts. This is the default action for
PostScript printers.
dmCollate
Specifies whether collation should be used when printing multiple
copies. (This member is ignored unless the printer driver indicates
support for collation by setting the dmFields member to
DM_COLLATE.) This member can be one of the following values:
Constant Description
DMCOLLATE_TRUE Collate when printing multiple
copies.
DMCOLLATE_FALSE Do not collate when printing
multiple copies.
Constant Description
DM_GRAYSCALE Specifies that the display is a NON-
color device. If this flag is not set,
color is assumed.
DM_INTERLACED Specifies that the display mode is
interlaced. If the flag is not set, NON-
interlaced is assumed. Windows 95:
Display drivers use this member, for
example, in the
ChangeDisplaySettings function.
Printer drivers do not use this
member.
dmICMIntent
Windows 95: Specifies which of the three possible color matching
methods, or intents, should be used by default. This member is
primarily for non-ICM applications. ICM applications can establish
intents by using the ICM functions. This member can be one of the
following predefined values, or a driver defined value greater than
the value of DMICM_USER:
dmMediaType
Windows 95: Specifies the type of media being printed on. The
member can be one of the following predefined values, or a driver-
defined value greater than the value of DMMEDIA_USER:
Windows NT: This member is not supported on Windows NT.
dmDitherType
Windows 95: Specifies how dithering is to be done. The member can
be one of the following predefined values, or a driver-defined value
greater than the value of DMDITHER_USER:
Windows NT: This member is not supported on Windows NT.
Remarks A device driver's private data follows the public portion of the
DEVMODE structure. The size of the public data can vary for
different versions of the structure. The dmSize member specifies the
number of bytes of public data, and the dmDriverExtra member
specifies the number of bytes of private data.
DEVMODE 16-bit
(VB Type Listing) Type DEVMODE
dmDeviceName As String * 32
dmSpecVersion As Integer
dmDriverVersion As Integer
dmSize As Integer
dmDriverExtra As Integer
dmFields As Long
dmOrientation As Integer
dmPaperSize As Integer
dmPaperLength As Integer
dmPaperWidth As Integer
dmScale As Integer
DM_ORIENTATION &H1&
DM_PAPERSIZE &H2&
DM_PAPERLENGTH &H4&
DM_PAPERWIDTH &H8&
DM_SCALE &H10&
DMORIENT_PORTRAIT
DMORIENT_LANDSCAPE
dmPaperSize
Specifies the size of the paper to print on. This member may be set
to zero if the length and width of the paper are specified by the
dmPaperLength and dmPaperWidth members, respectively.
Otherwise, the dmPaperSize member can be set to one of the
following predefined values:
Constant Value
DMRES_DRAFT -1
DMRES_LOW -2
DMRES_MEDIUM -3
DMRES_HIGH -4
Constant Value
DMCOLOR_MONOCHROME 1
DMCOLOR_COLOR 2
dmDuplex
Specifies duplex (double-sided) printing for printers capable of
duplex printing. This member can be one of the following values:
Constant Value
DMDUP_SIMPLEX 1
DMDUP_VERTICAL 2
DMDUP_HORIZONTAL 3
DEVMODE 16-bit
(Delphi Record The TDevMode record is defined under the WINTYPES.PAS file in
Delphi. You do not need to define this record in your own
Listing) application, simply verify that your application includes
WINTYPES.PAS. Documentation of TDevMode is provided here for
your own information only.
type
TDevMode = record
dmDeviceName: array[0..cchDeviceName-1] of
Char;
dmSpecVersion: Word;
dmDriverVersion: Word;
dmSize: Word;
dmDriverExtra: Word;
dmFields: LongInt;
dmOrientation: Integer;
dmPaperSize: Integer;
dmPaperLength: Integer;
dmPaperWidth: Integer;
dmScale: Integer;
dmCopies: Integer;
dmDefaultSource: Integer;
dmPrintQuality: Integer;
dmColor: Integer;
dmDuplex: Integer;
end;
dm_Orientation $0000001
dm_PaperSize $0000002
dm_PaperLength $0000004
dm_PaperWidth $0000008
dm_Scale $0000010
dm_Copies $0000100
dm_DefaultSource $0000200
dm_PrintQuality $0000400
dm_Color $0000800
dm_Duplex $0001000
dmorient_Portrait 1
dmorient_Landscape 2
dmPaperSize
Specifies the size of the paper to print on. This member may be set
to zero if the length and width of the paper are specified by the
dmPaperLength and dmPaperWidth members, respectively.
Otherwise, the dmPaperSize member can be set to one of the
following predefined values:
Constant Value
dmbin_First 1
dmbin_Upper 1
dmbin_OnlyOne 1
Constant Value
dmres_Draft -1
dmres_Low -2
dmres_Medium -3
dmres_High -4
dmDuplex
Specifies duplex (double-sided) printing for printers capable of
duplex printing. This member can be one of the following values:
dmdup_Simplex (1)
dmdup_Vertical (2)
dmdup_Horizontal (3)
32-bit
type
PDeviceMode = PDeviceModeA;
dmDeviceName: array[0..CCHDEVICENAME - 1]
of AnsiChar;
dmSpecVersion: Word;
dmDriverVersion: Word;
dmSize: Word;
dmDriverExtra: Word;
dmFields: DWORD;
dmOrientation: SHORT;
dmPaperSize: SHORT;
dmPaperLength: SHORT;
dmPaperWidth: SHORT;
dmScale: SHORT;
dmCopies: SHORT;
dmDefaultSource: SHORT;
dmPrintQuality: SHORT;
dmColor: SHORT;
dmDuplex: SHORT;
dmYResolution: SHORT;
dmTTOption: SHORT;
dmCollate: SHORT;
dmFormName: array[0..CCHFORMNAME - 1] of
AnsiChar;
dmLogPixels: Word;
dmBitsPerPel: DWORD;
dmPelsWidth: DWORD;
dmPelsHeight: DWORD;
dmDisplayFlags: DWORD;
dmDisplayFrequency: DWORD;
Constant Value
DM_ORIENTATION 1
DM_PAPERSIZE 2
DM_PAPERLENGTH 4
DM_PAPERWIDTH 8
Constant Value
DMORIENT_PORTRAIT 1
DMORIENT_LANDSCAPE 2
dmPaperSize
Specifies the size of the paper to print on. This member may be set
to zero if the length and width of the paper are specified by the
dmPaperLength and dmPaperWidth members, respectively.
Otherwise, the dmPaperSize member can be set to one of the
following predefined values:
Constant Value
DMBIN_UPPER 1
DMBIN_FIRST DMBIN_UPPER
DMBIN_ONLYONE 1
DMBIN_LOWER 2
DMBIN_MIDDLE 3
DMBIN_MANUAL 4
DMBIN_ENVELOPE 5
DMBIN_ENVMANUAL 6
DMBIN_AUTO 7
Constant Value
DMRES_DRAFT (-1)
DMRES_LOW (-2)
DMRES_MEDIUM (-3)
DMRES_HIGH (-4)
Constant Value
DMCOLOR_MONOCHROME 1
DMCOLOR_COLOR 2
dmDuplex
Specifies duplex (double-sided) printing for printers capable of
duplex printing. This member can be one of the following values:
dmYResolution
Specifies the y-resolution of the printer, in dots per inch. If the printer
initializes this member, the dmPrintQuality member specifies the x-
resolution of the printer, in dots per inch.
dmTTOption
Specifies how TrueType fonts should be printed. It can be one of the
following values:
dmCollate
Specifies whether collation should be used when printing multiple
copies. (This member is ignored unless the printer driver indicates
support for collation by setting the dmFields member to
DM_COLLATE.) This member can be one of the following values:
Constant Description
DMCOLLATE_FALSE 0
DMCOLLATE_TRUE 1
NOTE: Using DMCOLLATE_TRUE provides faster, more efficient
output for collation, since the data is sent to the device driver just
once, no matter how many copies are required. The printer is told to
simply print the page again.
dmFormName
Windows NT: Specifies the name of the form to use; for
example,"Letter" or "Legal". A complete set of names can be
retrieved by using the EnumForms function. Windows 95: Printer
drivers do not use this member.
dmMediaType
Windows 95: Specifies the type of media being printed on. The
member can be one of the following predefined values, or a driver-
defined value greater than the value of DMMEDIA_USER:
Windows NT: This member is not supported on Windows NT.
dmDitherType
Windows 95: Specifies how dithering is to be done. The member can
be one of the following predefined values, or a driver-defined value
greater than the value of DMDITHER_USER:
Windows NT: This member is not supported on Windows NT.
Remarks: A device driver's private data follows the public portion of the
DEVMODE structure. The size of the public data can vary for
different versions of the structure. The dmSize member specifies the
number of bytes of public data, and the dmDriverExtra member
specifies the number of bytes of private data.
PECharSepFileOptions
32-bit
type PECharSepFileOptions
structSize As Integer
UseReportNumberFmt As Integer
reserved1 As Integer
UseReportDateFormat As Integer
reserved2 As Integer
StringDelimiter As String * 1
FieldDelimiter As String *
(PE_FIELDDELIMLEN)
End Type
Members structSize
Specifies the size of the PECharSepFileOptions structure. You must
initialize this number to be the size of whatever it is, for example,
options.structSize = PE_SIZEOF_CHAR_SEP_FILE_OPTIONS.
UseReportNumberFmt
Indicates whether or not the program should save numbers in the
same format (decimal places, negatives, etc.) that you have used in
the report. Pass TRUE if you want the program to use the same
format used in the report, FALSE if you want number saved in a
format that has been optimized for the file format you have selected.
reserved1
(32-bit only. Reserved member used internally. Do not set a value.
UseReportDateFormat
Indicates whether or not the program should save dates in the same
format (MDY, DMY, etc.) that you used in the report. Pass TRUE if
you want the program to use the same format as used in the report,
FALSE if you want dates saved in a format that has been optimized
for the file format you have selected.
PEExportOptions
Members structSize
Specifies the size of the PEExportOptions structure. You must
initialize the member to be the size of whatever it is, for example,
options.structSize = PE_SIZEOF_EXPORT_OPTIONS.
formatDLLName
Specifies the pointer to the null-terminated string that contains the
format DLL name. The DLL you use is determined by the format in
which you want to export your report.
To export a report in
Use this formatType
this format
Crystal Reports Format UXFCrystalReportType
Data Interchange UXFDIFType
Format
Word for Windows UXFWordWinType
Format
Word for DOS Format UXFWordDosType
WordPerfect Format UXFWordPerfectType
Quattro Pro 5.0 (WB1) UXFQP5Type
Format
Record Style Format UXFRecordType
(column of values)
Rich Text Format UXFRichTextFormatType
Comma Separated UXFCommaSeparatedType
Values Format (CSV)
Tab Separated Values UXFTabSeparatedType
Format
Character Separated UXFCharSeparatedType
Values Format
Text Format (ASCII) UXFTextType
Paginated Text Format UXFPaginatedTextType
(ASCII)
Tab Separated Text UXFTabbedTextType
Format
To export a
Use this DLL Use this DLL
report to this name 16-bit name 32-bit
destination
Disk File uxddisk.dll u2ddisk.dll
E-Mail (MAPI) uxdmapi.dll u2dmapi.dll
E-Mail (VIM) uxdvim.dll u2dvim.dll
Microsoft uxdpost.dll u2dpost.dll
Exchange
destinationType
Specifies the type of destination you want to use from those types
supported by the selected DLL. Even if the destinationDLL name
you select supports only one destination type, you must still fill in
this member.
Select the destination type you want to use from the table below:
To export a report to
Use this destinationType
this destination
Disk File UXDDiskType
E-Mail (MAPI) UXDMAPIType
E-Mail (VIM) UXDVIMType
Microsoft Exchange UXDExchFolderType
destinationType1 & 2
Visual Basic 32-bit only
destinationOptions
Specifies a pointer to a structure supplying information used by the
PEExportOptions structure. This information is needed to export a report
and hard code the file name (when exporting to Disk File) or E-mail
message information (when exporting to MAPI or VIM destination).
destinationOptions1 & 2
Visual Basic 32-bit only
WARNING: destinationOptions must be pointing to a valid address
until PEStartPrintJob is called.
NOTE: formatOptions and destinationOptions must be pointing to
valid addresses until PEStartPrintJob is called.
PEExportOptions 16-bit
(VB Type Listing) Type PEExportOptions
StructSize As Integer
FormatDLLName As String * PE_DLL_NAME_LEN
FormatType As Long
FormatOptions As Long
DestinationDLLName As String *
PE_DLL_NAME_LEN
DestinationType As Long
DestinationOptions As Long
NFormatOptionsBytes As Integer
NDestinationOptionsBytes As Integer
End Type
32-bit
Type PEExportOptions
StructSize As Integer
FormatDLLName As String * PE_DLL_NAME_LEN
FormatType1 As Integer
FormatType2 As Integer
FormatOptions1 As Integer
FormatOptions2 As Integer
PEExportOptions 16-bit
(Delphi Record type
PEExportOptions = record
Listing) structSize: Word;
formatDLLName: PEDllNameType;
formatType: longint;
formatOptions: Pointer;
destinationDLLName: PEDllNameType;
destinationType: longint;
destinationOptions: Pointer;
nFormatOptionsBytes: Word;
nDestinationOptionsBytes: Word;
end;
32-bit
type
PEExportOptions = record
structSize: Word;
formatDLLName: PEDllNameType;
formatType: DWord;
formatOptions: Pointer;
destinationDLLName: PEDllNameType;
destinationType: DWord;
destinationOptions: Pointer;
nFormatOptionsBytes: Word;
nDestinationOptionsBytes: Word;
end;
PEGraphDataInfo
Members structSize
Specifies the size of the PEGraphDataInfo structure. You must
initialize this member to be the size of the structure, for example:
info.structSize = PE_SIZEOF_GRAPH_DATA_INFO.
rowGroupN
Specifies which group number in the report is used to create the
values in the rows of the graph. Use
PE_GRAPH_DATA_NULL_SELECTION if you don’t want to
specify a value.
colGroupN
Specifies which group number in the report is used to create the
values in the columns of the graph. Use
PE_GRAPH_DATA_NULL_SELECTION if you don’t want to
specify a value.
summarizedFieldN
Specifies which summary field in the report is used to set the values
of the risers in the graph. Summary fields are numbered in order of
their creation. Use PE_GRAPH_DATA_NULL_SELECTION if you
don’t want to specify a value.
graphDirection
For normal group/total report, the direction, is always
PE_GRAPH_COLS_ONLY.
For Cross-Tab reports, use any of the following constant values:
Constant Meaning
PE_GRAPH_ROWS_ONLY Use only row values in
graph.
PE_GRAPH_COLS_ONLY Use only column values in
graph.
PEGraphDataInfo 16-bit
(VB Type Listing) Type PEGraphDataInfo
structSize As Integer
RowGroupN As Integer
ColGroupN As Integer
SummarizedFieldN As Integer
GraphDirection As Integer
End Type
32-bit
Type PEGraphDataInfo
structSizeAs Integer
RowGroupNAs Integer
ColGroupNAs Integer
SummarizedFieldN As Integer
GraphDirection As Integer
End Type
PEGraphDataInfo 16-bit
(Delphi Record type
PEGraphDataInfo = record
Listing) structSize: integer;
rowGroupN: integer;
colGroupN: integer;
summarizedFieldN: integer;
graphDirection: integer;
end;
PEGraphOptions
Members structSize
Specifies the size of the PEGraphOptions structure. You must
initialize this member to be the size of the structure, for example:
options.structSize = PE_SIZEOF_GRAPH_OPTIONS.
graphMaxValue
Specifies the maximum value that will appear in the graph. Any
graph values above this value are not charted.
graphMinValue
Specifies the minimum value that will appear in the graph. Any
graph values below this value are not charted.
PEGraphOptions 16-bit
(VB Type Listing) Type PEGraphOptions
structSize As Integer
GraphMaxValue As Double
GraphMinValue As Double
ShowDataValue As Integer
ShowGridLine As Integer
VerticalBars As Integer
ShowLegend As Integer
FontFaceName As String *
[PE_GRAPH_TEXT_LEN]
End Type
32-bit
Type PEGraphOptions
structSizeAs Integer
GraphMaxValueAs Double
GraphMinValueAs Double
ShowDataValueAs Integer
ShowGridLineAs Integer
VerticalBarsAs Integer
ShowLegend As Integer
FontFaceNameAs String * PE_GRAPH_TEXT_LEN
End Type
32-bit
type
PEGraphOptions = record
structSize: Word;
graphMaxValue: Double;
graphMinValue: Double;
showDataValue: Bool;
showGridLine: Bool;
verticalBars: Bool;
showLegend: Bool;
fontFaceName: PEGraphTextType;
end;
PEGraphTextInfo
PEGraphTextInfo 16-bit
(VB Type Listing) Type PEGraphTextInfo
structSize As Integer
GraphTitle As String * [PE_GRAPH_TEXT_LEN]
GraphSubTitle As String *
[PE_GRAPH_TEXT_LEN]
GraphFootNote As String *
32-bit
Type PEGraphTextInfo
structSizeAs Integer
GraphTitleAs String * PE_GRAPH_TEXT_LEN
GraphSubTitleAs String * PE_GRAPH_TEXT_LEN
GraphFootNoteAs String * PE_GRAPH_TEXT_LEN
GraphGroupsTitleAs String *
PE_GRAPH_TEXT_LEN
GraphSeriesTitleAs String *
PE_GRAPH_TEXT_LEN
GraphXAxisTitleAs String *
PE_GRAPH_TEXT_LEN
GraphYAxisTitleAs String *
PE_GRAPH_TEXT_LEN
GraphZAxisTitleAs String *
PE_GRAPH_TEXT_LEN
End Type
PEGraphTextInfo 16-bit
(Delphi Record type
PEGraphTextInfo = record
Listing) structSize: Word;
graphTitle: PEGraphTextType;
graphSubTitle: PEGraphTextType;
graphFootNote: PEGraphTextType;
graphGroupsTitle: PEGraphTextType;
graphSeriesTitle: PEGraphTextType;
graphXAxisTitle: PEGraphTextType;
graphYAxisTitle: PEGraphTextType;
graphZAxisTitle: PEGraphTextType;
end;
PEJobInfo
Members structSize
Specifies the size of the PEJobInfo structure. You must initialize this
member to be the size of whatever it is, for example, job.structSize =
PE_SIZEOF_JOB_INFO.
NumRecordsRead
Specifies the number of records actually processed.
NumRecordsSelected
Specifies the number of records selected for inclusion in the report
out of the total number of records read.
PEJobInfo 16-bit
(VB Type Listing) Type PEJobInfo
StructSize As Integer
NumRecordsRead As Long
NumRecordsSelected As Long
NumRecordsPrinted As Long
DisplayPageN As Integer
LatestPageN As Integer
StartPageN As Integer
PrintEnded As Integer
End Type
32-bit
Type PEJobInfo
StructSize As Integer
NumRecordsRead As Long
NumRecordsSelected As Long
NumRecordsPrinted As Long
DisplayPageN As Integer
LatestPageN As Integer
StartPageN As Integer
PrintEnded As Long
End Type
32-bit
type
PEJobInfo = record
structSize: Word;
NumRecordsRead: Longint;
NumRecordsSelected: Longint;
NumRecordsPrinted: Longint;
DisplayPageN: Word;
LatestPageN: Word;
StartPageN: Word;
PrintEnded: Bool;
end;
PELogOnInfo
Remarks For Netware SQL, pass the dictionary path name in ServerName and
data path name in DatabaseName.
PELogOnInfo 16-bit
(VB Type Listing) Type PELogOnInfo
structSize As Integer
ServerName As String * PE_SERVERNAME_LEN
DatabaseName As String *
PE_DATABASENAME_LEN
UserID As String * PE_USERID_LEN
Password As String * PE_PASSWORD_LEN
End Type
PELogOnInfo 16-bit
(Delphi Record type
PELogOnInfo = record
Listing) structSize: Word;
ServerName: PELogonServerType;
DatabaseName: PELogonDbType;
UserId: PELogonUserType;
Password: PELogonPassType;
end;
32-bit
type
PELogOnInfo = record
structSize: Word;
ServerName: PELogonServerType;
DatabaseName: PELogonDbType;
UserId: PELogonUserType;
Password: PELogonPassType;
end;
PEParameterFieldInfo
Members structSize
(when used with Specifies the size of the PEParameterFieldInfo structure. You must
initialize this member to the size of whatever it is, for example,
PEGetNth info.structSize = PE_SIZEOF_PARAMETER_FIELD_INFO.
ParameterField) ValueType
Specifies the data type of the parameter field. The Report Engine
supports the following data types: number, currency, Boolean, date,
and string. Use the appropriate constant from the list below.
DefaultValueSet
Indicates whether or not a default value was set for the parameter
field when the parameter field was created or modified in Crystal
Reports. The value can be either TRUE (1) if the field was given a
default value or FALSE (0) if it was not.
CurrentValueSet
If PEStartPrintJob has not been called, this parameter will equal 0.
Since the print job hasn’t been started, there is no current value set by
code or by the user.
If PEStartPrintJob has been called, and the user has entered a
parameter and said OK to the prompt, this parameter will equal 1
(TRUE) if the user enters a value at the prompt and 0 (FALSE) if the
user clicks Cancel.
PEParameter 16-bit
FieldInfo Type PEParameterFieldInfo
structSize As Integer
(VB type listing) ValueType As Integer
DefaultValueSet As Integer
CurrentValueSet As Integer
Name As String * PE_PF_NAME_LEN
Prompt As String * PE_PF_PROMPT_LEN
DefaultValue As String * PE_PF_VALUE_LEN
CurrentValue As String * PE_PF_VALUE_LEN
End Type
32-bit
Type PEParameterFieldInfo
structSize As Integer
ValueType As Integer
DefaultValueSet As Integer
CurrentValueSet As Integer
Name As String * PE_PF_NAME_LEN
Prompt As String * PE_PF_PROMPT_LEN
DefaultValue As String * PE_PF_VALUE_LEN
CurrentValue As String * PE_PF_VALUE_LEN
End Type
PEParameter 16-bit
FieldInfo type
PEParameterFieldInfo = record
(Delphi listing) structSize: Word;
ValueType: Word;
DefaultValueSet: Word;
CurrentValueSet: Word;
Name: PEPromptVarNameType;
Prompt: PEPromptVarTextType;
DefaultValue: PEPromptVarValueType;
CurrentValue: PEPromptVarValueType;
end;
PEParameterInfo
Members structSize
Specifies the size of the PEParameterInfo structure. You must
initialize this member to be the size of whatever it is, for example,
info.structSize = PE_SIZEOF_PAREMETER_INFO.
Type
Specifies the data type of the parameter. The Report Engine supports
the following data types: number, currency, Boolean, date, and
string.
Use the appropriate constant from the list below.
PEParameterInfo 16-bit
(VB Type Listing) Type PEParameterInfo
structSize As Integer
Type As Integer
name As String * PE_PARAMETER_NAME_LEN
End Type
32-bit
Type PEParameterInfo
structSize As Integer
Type As Integer
Name As String * PE_PARAMETER_NAME_LEN
End Type
PEParameterInfo 16-bit
(Delphi Record type
PEParameterInfo = record
Listing) structSize: Word;
paramType: Word;
Name: PEProcParamNameType;
end;
32-bit
type
PEParameterInfo = record
structSize: Word;
paramType: Word;
Name: PEProcParamNameType;
end;
PEPrintFileOptions 16 -bit
(VB Type Listing) type PEPrintFileOptions
structSize As Integer
UseReportNumberFmt As Integer
UseReportDateFormat As Integer
End Type
32 -bit
type PEPrintFileOptions
structSize As Integer
UseReportNumberFmt As Integer
reserved1 As Integer
UseReportDateFormat As Integer
reserved2 As Integer
End Type
Members structSize
Specifies the size of the PEPrintFileOptions structure. You must
initialize this member to be the size of whatever it is, for example,
printfile.structSize = PE_SIZEOF_PRINT_FILE_OPTIONS.
UseReportNumberFmt
Indicates whether or not the program should save numbers in the
same format (decimal places, negatives, etc.) that you have used in
the report. Pass TRUE if you want the program to use the same
format used in the report, FALSE if you want number saved in a
format that has been optimized for the file format you have selected.
reserved1
32- bit only. A reserved member. Do not set a value.
UseReportDateFormat
Indicates whether or not the program should save dates in the same
format (MDY, DMY, etc.) that you used in the report. Pass TRUE if
you want the program to use the same format as used in the report,
FALSE if you want dates saved in a format that has been optimized
for the file format you have selected.
PEPrintOptions
Members structSize
Specifies the size of the PEPrintOptions structure. You must initialize
this member to be the size of whatever it is, for example,
options.structSize = PE_SIZEOF_PRINT_OPTIONS.
startPageN
Specifies the first page that you want to print. Page numbers are 1
origin (Page 1 = 1, Page 2 = 2, etc.). Enter 0 if you want to retain the
existing settings.
stopPageN
Specifies the last page that you want to print. Page numbers are 1
origin (Page 1 = 1, Page 2 = 2, etc.). Enter 0 if you want to retain the
existing settings.
nReportCopies
Specifies the number of copies you want to print. Copy numbers, like
page numbers, are 1 origin. Enter 0 if you want to retain the existing
settings.
collation
Indicates whether or not you want the program to collate the copies
(if you are printing multiple copies of a multiple page report).
Constant Action
PE_UNCOLLATED Prints multiple copies of a
multiple page report uncollated
(Page order = 1, 1, 1, 2, 2, 2, 3, 3, 3,
etc.)
PE_COLLATED Prints multiple copies of a
multiple page report collated
(Page order = 1, 2, 3, ..., 1, 2, 3, ...,
etc.)
PE_DEFAULTCOLLATION Prints multiple copies of a
multiple page report using the
collation settings as specified in
the report.
PEPrintOptions 16-bit
(VB Type Listing) Type PEPrintOptions
structSize As Integer
StartPageN As Integer
stopPageN As Integer
nReportCopies As Integer
collation As Integer
End Type
32-bit
Type PEPrintOptions
structSize As Integer
StartPageN As Integer
stopPageN As Integer
nReportCopies As Integer
collation As Integer
End Type
32-bit
type
PEPrintOptions = record
structSize: Word;
StartPageN: Word;
StopPageN: Word;
nReportCopies: Word;
Collation: Word;
end;
PESectionOptions
PESectionOptions 16-bit
(VB Type Listing) Type PESectionOptions
structSize As Integer
visible As Integer
NewPageBefore As Integer
NewPageAfter As Integer
KeepTogether As Integer
SuppressBlankSection As Integer
resetPageNAfter As Integer
printAtBottomOfPage As Integer
backgroundColor As Long
underlaySection As Integer
End Type
32-bit
Type PESectionOptions
structSize As Integer
Visible As Integer
NewPageBefore As Integer
NewPageAfter As Integer
KeepTogether As Integer
SuppressBlankSection As Integer
ResetPageNAfter As Integer
PrintAtBottomOfPage As Integer
backgroundColor As Long
underlaySection As Integer
End Type
32-bit
type
PESectionOptions = record
structSize: Word;
visible: integer;
newPageBefore: integer;
newPageAfter: integer;
keepTogether: integer;
suppressBlankSection: integer;
resetPageNAfter: integer;
printAtBottomOfPage: integer;
backgroundColor: COLORREF;
underlaySection: integer;
end;
PESessionInfo
PESessionInfo 16-bit
(VB Type Listing) Type PESessionInfo
structSize As Integer
UserID As String * PE_SESS_USERID_LEN
Password As String * PE_SESS_PASSWORD_LEN
SessionHandle As Long
End Type
32-bit
Type PESessionInfo
structSize As Integer
UserID As String * PE_SESS_USERID_LEN
Password As String * PE_SESS_PASSWORD_LEN
SessionHandle As Long
End Type
32-bit
type
PESessionInfo = record
StructSize: Word;
UserID: PESesPassType;
Password: PESesPassType;
SessionHandle: DWORD;
end;
PESubreportInfo
Members structSize
Specifies the size of the PESubreportInfo structure. You must
initialize this member to be the size of whatever it is, for example
location.structSize = PE_SIZEOF_SUBREPORT_INFO
name
Specifies the name of the subreport. This is the name assigned to the
subreport when it was first created.
PESubreportInfo 16-bit
(VB Type Listing) Type PESubreportInfo
structSize As Integer
Name As String * PE_SUBREPORT_NAME_LEN
End Type
32-bit
Type PESubreportInfo
structSize As Integer
Name As String * PE_SUBREPORT_NAME_LEN
End Type
PESubreportInfo 16-bit
(Delphi Record type
PESubreportInfo = record
Listing) structSize: Word;
name: PESubreportNameType;
end;
32-bit
type
PESubreportInfo = record
structSize: Word;
name: PESubreportNameType;
end;
Related Topics
Working with subreports 36
PETableLocation
Members structSize
Specifies the size of the PETableLocation structure. You must
initialize this member to be the size of whatever it is, for example
location.structSize = PE_SIZEOF_TABLE_LOCATION.
Location
Specifies the database location. This member is database dependent
and must be formatted correctly for the expected database, for
example:
● xBASE (Natively): <drive>:\<path>\<file>
● xBASE (ODBC): <datasource name>
● Paradox (Natively): <drive>:\<path>\<file>
● Paradox (ODBC): <datasource name>
● Btrieve (Natively): <drive>:\<path>\<file>
● Btrieve (ODBC): <datasource name>
● Oracle (Natively): <database>.<table>
● Oracle (ODBC): <database>.<table>
● SQL Server (Natively): <database>.<owner>.<table>
● SQL Server (ODBC): <database>.<owner>.<table>
PETableLocation 16-bit
(VB Type Listing) Type PETableLocation
structSize As Integer
Location As String * PE_TABLE_LOCATION_LEN
End Type
PETableLocation 16-bit
(Delphi Record type
PETableLocation = record
Listing) structSize: Word;
Location: PETableLocType;
end;
32-bit
type
PETableLocation = record
structSize: Word;
Location: PETableLocType;
end;
PETableType
Members structSize
Specifies the size of the PETableType structure. You must initialize
this member to be the size of whatever it is, for example,
TableType.structSize = PE_SIZEOF_TABLE_TYPE.
DLLName
Specifies the name of the appropriate database DLL for the table of
interest (in quotes).
DescriptiveName
Specifies the name of the table of interest (in quotes).
DBType
Specifies the type of database that contains the table of interest. Select
DB type from the table below:
Value Meaning
PE_DT_STANDARD The type for standard, non-SQL
databases.
PE_DT_SQL The type for SQL databases.
PETableType 16-bit
(VB Type Listing) Type PETableType
structSize As Integer
DLLName As String * PE_DLL_NAME_LEN
DescriptiveName As String *
PE_FULL_NAME_LEN
DBType As Integer
End Type
32-bit
Type PETableType
structSize As Integer
DLLName As String * PE_DLL_NAME_LEN
DescriptiveName As String *
PE_FULL_NAME_LEN
DBType As Integer
End Type
PETableType 16-bit
(Delphi Record type
PETableType = record
Listing) structSize: Word;
DLLName: PEDllNameType;
DescriptiveName: PEFullNameType;
DBType: Word;
end;
32-bit
type
PETableType = record
structSize: Word;
DLLName: PEDllNameType;
DescriptiveName: PEFullNameType;
DBType: Word;
end;
Members structSize
Specifies the size of the UXDDiskOptions structure. You must
initialize this member to be the size of whatever it is, for example,
options.structSize = UXDDiskOptionsSize.
fileName
Specifies the pointer to the null-terminated string that contains the
file name under which you want your disk file saved.
UXDDiskOptions 16-bit
(Delphi Record type
UXDDiskOptions = record
Listing) structSize: Integer;
fileName: PChar;
end;
32-bit
type
UXDDiskOptions = record
structSize: Word;
fileName: PChar;
end;
Members structSize
Specifies the size of the UXDMAPIOptions structure. You must
initialize this member to be the size of whatever it is, for example,
options.structSize = UXDMAPIOptionsSize
toList
Specifies the pointer to the null-terminated string that contains the
"To" list to which you want your E-mail message directed. If you
specify "recipients" in this structure, "toList" is ignored.
ccList
Specifies the pointer to the null-terminated string that contains the
"CC" list to which you want your E-mail message copied. This string
will appear on the message. If you specify "recipients" in this
structure, "ccList" is ignored.
subject
Specifies the pointer to the null-terminated string you want to
appear as the subject line in the E-mail message.
message
Specifies the pointer to the null-terminated string you want to
appear as the body of your E-mail message.
nRecipients
Specifies the number of recipients that are to receive the E-mail
message. You must pass the value "0" if you specify "To" and "CC"
lists in this structure.
UXDMAPIOptions 16-bit
(Delphi Record type
UXDMAPIOptions = record
Listing) structSize: integer;
toList: PChar;
ccList: PChar;
subject: PChar;
message: PChar;
end;
32-bit
type
UXDMAPIOptions = record
structSize: Word;
toList: PChar;
ccList: PChar;
subject: PChar;
message: PChar;
end;
UXDPostFolderOptions
Members structSize
Specifies the size of the UXDPostFolderOptions structure. You must
initialize this member to be the size of whatever it is, for example,
options.structSize = UXDPostFolderOptionsSize.
pszProfile
Specifies the Exchange profile.
pszPassword
Specifies the Exchange password.
wDestType
Specifies the type of report to export to. Use one of the following
pszFolderPath
Specifies the Exchange path where you want the program to place
the exported file.
UXDPostFolder 16-bit
Options type
UXDPostFolderOptions = record
(Delphi Record structSize: Integer;
Listing) pszProfile: PChar;
pszPassword: PChar;
wDestType: Integer;
pszFolderPath: PChar;
end;
32-bit
type
UXDPostFolderOptions = record
structSize: Word;
pszProfile: PChar;
pszPassword: PChar;
wDestType: Word;
pszFolderPath: PChar;
end;
UXDVIMOptions
UXDVIMOptions 16-bit
(Delphi Record type
UXDVIMOptions = record
Listing) structSize: integer;
toList: PChar;
ccList: PChar;
bccList: PChar;
subject: PChar;
message: PChar;
end;
32-bit
Crystal Reports 32-bit does not export to VIM.
Members structSize
Specifies the size of the UXFCharSeparatedOptions structure. You
must initialize this member to be the size of whatever it is, for
example, options.structSize = UXFCharSeparatedOptionsSize.
useReportNumberFormat
Indicates whether or not the program should save numbers in the
same format (decimal places, negatives, etc.) that you have used in
the report. Pass TRUE if you want the program to use the same
format used in the report, FALSE if you want the number saved in a
format that has been optimized for the file format you have selected.
useReportDateFormat
Indicates whether or not the program should save dates in the same
format (MDY, DMY, etc.) that you used in the report. Pass TRUE if
you want the program to use the same format as used in the report,
FALSE if you want dates saved in a format that has been optimized
for the file format you have selected
stringDelimiter
Specifies the character you want to use to enclose Alphanumeric
field data in the character separated values format. You can use
whatever character you wish, and it must be enclosed in quotes.
fieldDelimiter
Specifies a pointer to the string you want to use to separate the fields
in the character separated values format. Your string may be up to 16
characters long and must be enclosed in quotes.
UXFChar 16-bit
SeparatedOptions type
UXFCharSeparatedOptions = record
(Delphi Record structSize: integer;
Listing) useReportNumberFormat: Bool;
useReportDateFormat: Bool;
stringDelimiter: Char;
fieldDelimiter: PChar;
end;
32-bit
type
UXFCharSeparatedOptions = record
structSize: Word;
useReportNumberFormat: Bool;
useReportDateFormat: Bool;
stringDelimiter: Char;
fieldDelimiter: PChar;
end;
UXFCommaTabSeparatedOptions
Members structSize
Specifies the size of the UXFCommaTabSeparatedOptions structure.
You must initialize this member to be the size of whatever it is, for
example, options.structSize =
UXFCommaTabSeparatedOptionsSize.
UXFCommaTab 16-bit
SeparatedOptions type
UXFCommaTabSeparatedOptions = record
(Delphi Record structSize: integer;
Listing) useReportNumberFormat: Bool;
useReportDateFormat: Bool;
end;
32-bit
type
UXFCommaTabSeparatedOptions = record
structSize: Word;
useReportNumberFormat: Bool;
useReportDateFormat: Bool;
end;
UXFDIFOptions
Members structSize
Specifies the size of the UXFDIFOptions structure. You must
initialize this member to be the size of whatever it is, for example,
options.structSize = UXFDIFOptionsSize.
useReportNumberFormat
Indicates whether or not the program should save numbers in the
same format (decimal places, negatives, etc.) that you have used in
the report. Pass TRUE if you want the program to use the same
format used in the report, FALSE if you want the number saved in a
format that has been optimized for the file format you have selected.
useReportDateFormat
Indicates whether or not the program should save dates in the same
format (MDY, DMY, etc.) that you used in the report. Pass TRUE if
you want the program to use the same format as used in the report,
FALSE if you want dates saved in a format that has been optimized
for the file format you have selected.
UXFDIFOptions 16-bit
(Delphi Record type
UXFCommaTabSeparatedOptions = record
Listing) structSize: integer;
useReportNumberFormat: Bool;
useReportDateFormat: Bool;
end;
32-bit
type
UXFDIFOptions = record
structSize: Word;
useReportNumberFormat: Bool;
useReportDateFormat: Bool;
end;
Members structSize
Specifies the size of the UXFHTML3Options structure. You must
initialize this member to be the size of whatever it is, for example,
options.structSize = UXFHTML3OptionsSize.
fileName
Specifies a null terminated file name.
UXFHTML3 16-bit
Options type
UXFHTML3Options = record
(Delphi Record structSize: Integer;
Listing) fileName: PChar;
baseURLName: PChar;
end;
32-bit
type
UXFHTML3Options = record
structSize: Word;
fileName: PChar;
baseURLName: PChar;
end;
Members structSize
Specifies the size of the UXFODBCOptions structure. You must
initialize this member to be the size of whatever it is, for example,
options.structSize = UXFODBCOptionsSize.
dataSourceName
Specifies the name of the data source that you want to export to.
dataSourceUserID
Specifies the User ID that you need to connect to the data source.
dataSourcePassword
Specifies the Password that you need to connect to the data source.
exportTableName
Specifies the name of the table you want to export to in the data
source.
UXFODBCOptions 16-bit
(Delphi Record type
UXFODBCOptions = record
Listing) structSize: integer;
dataSourceName: PChar;
dataSourceUserID: PChar;
dataSourcePassword: PChar;
exportTableName: PChar;
end;
UXFPaginatedTextOptions
struct UXFPaginatedTextOptions
{
WORD structSize;
WORD nLinesPerPage;
};
Members structSize
Specifies the size of the UXFPaginatedTextOptions structure. You
must initialize this member to be the size of whatever it is, for
example, options.structSize = UXFPaginatedTextOptionsSize.
nLinesPerPage
Indicates the number of lines to be printed before the page break. The
default is 60 lines. When the paginated text format is used with
PEGetExportOptions, the program displays the Lines Per Page
dialog box to give the user the opportunity to specify a different
number if he or she wishes.
UXFPaginatedText 16 bit
Options type
UXFPaginatedTextOptions = Record
(Delphi Record structSize: Integer;
Listing) nLinesPerPage: Integer;
end;
UXFRecordStyleOptions
Members structSize
Specifies the size of the UXFRecordStyleOptions structure. You must
initialize this member to be the size of whatever it is, for example,
options.structSize = UXFRecordStyleOptionsSize.
useReportNumberFormat
Indicates whether or not the program should save numbers in the
same format (decimal places, negatives, etc.) that you have used in
the report. Pass TRUE if you want the program to use the same
format used in the report, FALSE if you want the number saved in a
format that has been optimized for the file format you have selected.
useReportDateFormat
Indicates whether or not the program should save dates in the same
format (MDY, DMY, etc.) that you used in the report. Pass TRUE if
you want the program to use the same format as used in the report,
FALSE if you want dates saved in a format that has been optimized
for the file format you have selected.
UXFRecordStyle 16-bit
Options type
UXFRecordStyleOptions = record
(Delphi Record structSize: integer;
Listing) useReportNumberFormat: Bool;
useReportDateFormat: Bool;
end;
32-bit
type
UXFRecordStyleOptions = record
structSize: Word;
useReportNumberFormat: Bool;
useReportDateFormat: Bool;
end;
The name of your new function should reflect the purpose of the
function, making it easier to recognize when it appears in the
Formula Editor's Functions list. For example, a function named
"Picture" could let you specify a template picture of how data should
appear in the report. If a field contains phone numbers, you can use
the Picture function to specify that the data appear like this:
(xxx) xxx-xxxx
Function Data
UFL functions are much like any other function you might create in
C. They can accept values that are passed as parameters, and they
return a value that is printed on the report. Once you have
determined how a UFL function will perform a task, you will know
exactly what kind of data it will require to complete that operation.
The following table shows every data type that a UFL function can
accept as a parameter, along with a description of what the
parameter will look like in C.
Return Types Finally, you must determine what kind of data your function returns
to the current report in Crystal Reports. The following table lists
possible UFL return types along with a description of the C data type
used when programming the function.
Helper Modules
This topic is only supported by the Professional Edition of Crystal
Reports.
The following files have been installed on your system in the same
directory as CRW.EXE (C:\CRW by default):
Function Definition
This topic is only supported by the Professional Edition of Crystal
Reports.
Creating a UFL function requires that you create only one more C
code module and a module definition (.def) file in addition to the
Helper modules. (Your particular UFL Function needs may require
more modules, but the simplest method for creating a UFL requires
creating only these two.) For information on creating the module
definition file, see Module Definition File, Page 735. To begin building
your UFL, create a new C module in your IDE, and save it to your
working directory with the same name as your project file. For
example, if your project file is named UFLSAMP.MAK or
UFLFUNCS.PRJ, you would name your C module UFLSAMP.C or
UFLFUNCS.C respectively. For this demonstration, we will refer to
UFLSAMP.C. This is the "private" C module for your UFL because it
is the one section of code that must be unique to your UFL.
TermForJob Function
This topic is only supported by the Professional Edition of Crystal
Reports.
The TermForJob function terminates the job ID for all user function
UFL's whenever a job finishes. You can add any job termination code
here that you like, but all that is absolutely necessary is an empty
function implementation:
void TermForJob(UFTInt32u jobID)
{
}
NOTE: Every UFL must have an implementation of InitForJob (see
Page 729) and TermForJob. These functions are called when a job
starts and ends printing, respectively. You can choose to implement
these yourself. At a minimum, you must provide empty functions.
Crystal Reports provides helper modules (UFJOB.C and UFJOB.H)
which implement these functions and maintain a doubly linked list
of JobInfo structures, one for each active job. The JobInfo structure
(declared in UFJOB.H) holds the ID# of the job and contains a void
pointer where you can store any data that you allocate. The files also
implement a FindJobInfo function (see Page 738) which you can use
to retrieve the job information for any open job. We will examine
these files and their implementation of InitForJob and TermForJob
under UFJOB Modules (see Page 737).
#include <Windows.h>
#include "UFDll.h"
/* UDF PROTOTYPE */
ExternC UFError FAR _export PASCAL Picture
(UFParamBlock * ParamBlock);
/*****
* This array gives CRYSTAL the types for the
* parameters to our UDF, the return
* type, and the name. It also passes the
* address of the actual function code.
*****/
UFFunctionDefStrings FunctionDefStrings [] =
{
{"String Picture (String, String)",
Picture},
{NULL, NULL, NULL}
};
/*****
* The following is the template CRYSTAL
* REPORTS will insert into the Formula Editor
* "Formula text:" when this function is
* selected.
*****/
UFFunctionTemplates FunctionTemplates [] =
{
{"Picture (!, )"},
{NULL}
};
/*****
* The following is an example of the format
* for this function. This text will appear
* in the Functions list box of the Formula
* Editor.
*****/
UFFunctionExamples FunctionExamples [] =
{
{"\tPicture (string, picture)"},
/*****
* This array contains ASCII string
* representations of the errors which
* could occur.
*****/
char *ErrorTable [] =
{
"no error"
};
/* Called on termination */
void TermForJob (UFTInt32u jobID)
{
}
/*****
* This function is used by the Picture UDF to
* copy the contents of a source string and a
* format string into a destination string.
*****/
/*****
* This is our User Defined Function
*****/
UFJOB.C
UFJOB.H
Index-1
SetNthTableSession- Crystal NewEra Class Library developers
Info .......................... 257, 368 Overview............................ 322 what you should know ..........3
SetPrintDate............... 272, 384 Crystal Report Engine development
SetPrintOptions.......... 273, 385 adding to application ............ 4 Report Engine API................ 15
SetReportTitle ............ 272, 384 coding a custom print link... 21 DEVMODE ..............................619
SetSectionFormat ....... 298, 413 custom print link ................. 21 DEVMODE (Delphi Record
SetSelectionFormula .. 262, 374 declarations ........................ 16 Listing) ................................642
SetSQLQuery............. 271, 383 distributing applications ...... 35 DEVMODE (VB Type Listing) ...636
ShowFirstPage ........... 250, 361 error handling ..................... 30 DialogParentHandle
ShowLastPage............ 250, 362 introduction to ...................... 2 Property ........................ 60 , 140
ShowNextPage .......... 249, 361 PEPrintReport ...................... 17 DiscardSavedData Property 61 , 141
ShowNthPage ....................310 print only link ..................... 17 distributing Report Engine
ShowPreviousPage..... 250, 362 sample custom print link ..... 25 applications........................... 35
ShowPrintControls ..... 251, 363 structures ............................ 35
Start ...................................247 using ................................4, 16 E
StartJob ..............................358 Crystal Reports Engine Class Library EMailCCList Property ......... 62 , 141
TestNthTabl- Reference............................ 209 EMailMessage Property ...... 62 , 142
eConnectivity........... 254, 366 Crystal VCL................................ 11 EMailSubject Property ........ 63 , 142
ZoomPreviewWindow251, 363 adding to project ................. 11 EMailToList Property .......... 64 , 143
CRPEJobInfo .............................212 changing properties............. 13 EMailVIMBCCList Property. 64 , 143
CRPELogOnInfo ...............323, 210 using ................................... 12 Embedded quotes in Visual Basic
CRPEngine ...............................245 Crystal VCL Overview ............. 133 calls to the Report Engine ...... 41
CanClose .............. 245, 356 custom control............................. 5 Enabled Property......................144
Close .................... 238, 350 adding to project ................... 6 Encoding..................................429
CRPEngine ............ 237, 349 changing properties............7, 8 Error Table ...............................728
GetEngine ..................... 239 using ..................................... 7 errors in custom print link .......... 30
GetEngineStatus .... 240, 351 custom print link........................ 21 ExchangeFolder Property............ 65
GetErrorCode........ 245, 357 coding................................. 21 ExchangePassword Property....... 66
GetErrorText ......... 246, 357 errors .................................. 30 ExchangeProfile Property ........... 66
GetNPrintJobs ....... 245, 356 sample ................................ 25 Execute Property ......................144
GetVersion............ 239, 350 ExportPrintWindow Method .....201
LogOffServer......... 243, 354 D
LogOnServer......... 242, 353 DataFiles Property ..............57 , 137 F
LogOnSQLServerWith- DataFilesLocation Property ...... 138 features
PrivateInfo .......... 243, 355 dBASE for Windows Report Engine ........................2
Open .................... 238, 349 Report Engine API ............... 16 Focused Method ......................202
OpenJob ............... 240, 351 sample REAPI code ............. 34 Formulas Property .............. 67 , 145
PrintReport............ 241, 352 DCU.......................................... 11 Function Data ..........................719
CRPEParameterFieldInfo...........233 adding to project ................. 11 Function Definition ..................723
CRPEParameterInfo ..................235 changing properties............. 13 Function Definition Table ........725
CRPEPrintOptions ............ 216, 328 using ................................... 12 Function definition table
CRPESectionOptions ........ 223, 334 declarations example ..............................726
CRPESessionInfo............... 214, 326 REAPI .................................. 16 Function Examples Table .........727
CRPESubreportInfo ...................236 Decoding................................. 429 Function Templates Table ........726
CRPETableLocation .......... 215, 327 Delphi
CRPETableType................ 213, 325 adding VCL to project ......... 11 G
Crystal ActiveX Control ................8 changing VCL properties ..... 13
Crystal ActiveX Control Methods GraphData Property ................... 68
Report Engine API ............... 16 GraphOptions Property ...... 70 , 146
Index...................................129 sample REAPI code ............. 34
Crystal ActiveX Control Properties GraphText Property............ 72 , 148
using the Crystal VCL .......... 12
Index.....................................47 GraphType Property........... 73 , 149
Delphi VCL................................ 11
Crystal Custom Control ................5 GroupCondition Property... 74 , 151
Designing UFL Functions......... 718
adding to project ...................6 GroupSelectionFormula
Destination Property ...........59 , 138
changing properties ........... 7, 8 Property ........................ 78 , 152
DetailCopies Property.........60 , 139
using......................................7 GroupSortFields Property ... 76 , 153
Index-2
H P PEClosePrintJob (dBASE for
Windows Syntax) ................ 440
Hard-coded nulls in Visual Basic PageCount Method...........130, 202
PEClosePrintJob (Delphi
structures .............................. 44 PageFirst Method......................130 Syntax) ................................ 440
Helper Modules ....................... 721 PageLast Method ......................130
PEClosePrintJob (VB Syntax)..... 439
PageNext Method.....................131 PECloseSubreport..................... 440
I PagePrevious Method ...............131
PECloseSubreport (dBASE for
Identifying string issues in Visual PageShow Method....................131 Windows Syntax) ................ 441
Basic links to the Report PageZoom Method ...................132
PECloseSubreport (Delphi
Engine................................... 43 ParameterFields Property ......83, 84 Syntax) ................................ 441
Implementing InitJob and Passing dates/date ranges in Visual
PECloseSubreport (VB Syntax) .. 441
TermJob .............................. 738 Basic using the Report Engine PECloseWindow ...................... 441
InitForJob Function................... 729 API calls ................................42
PECloseWindow (dBASE for
interface Password Property ..............85 , 159 Windows Syntax) ................ 442
creating for Report Engine ..... 4 PECancelPrintJob......................431
PECloseWindow (Delphi
PECancelPrintJob (dBASE for Syntax) ................................ 442
K Windows Syntax).................432
PECloseWindow (VB Syntax) ... 442
Known problems with earlier PECancelPrintJob (Delphi PEDeleteNth GroupSortField
Syntax).................................432
versions of UFJob.C............. 740 (dBASE for Windows
PECancelPrintJob (VB Syntax) ...432 Syntax) ............................... 444
L PECanCloseEngine....................433
PEDeleteNth GroupSortField
PECanCloseEngine (dBASE for (Delphi Syntax) ................... 444
LastErrorNumber Property .. 79 , 155 Windows Syntax).................433
LastErrorString Property ...... 80 , 155 PEDeleteNth GroupSortField (VB
PECanCloseEngine (Delphi Syntax) ................................ 444
Library Syntax).................................433
Report Engine Class ............. 13 PEDeleteNthGroupSortField..... 443
PECanCloseEngine (VB Syntax).433 PEDeleteNthSort Field (dBASE for
PECharSepFileOptions..............660
M PECheckFormula ......................434
Windows Syntax) ................ 446
PEDeleteNthSort Field (Delphi
MarginBottom Property ...... 80 , 156 PECheckFormula (dBASE for
Syntax) ................................ 446
MarginLeft Property............ 81 , 157 Windows Syntax).................435 PEDeleteNthSort Field (VB
MarginRight Property ......... 82 , 157 PECheckFormula (Delphi
Syntax) ................................ 445
MarginTop Property ........... 82 , 158 Syntax).................................435 PEDeleteNthSortField............... 444
MDIChild Property................... 158 PECheckFormula (VB Syntax) ...434
PEDiscardSaved Data (dBASE for
Members (when used with PECheckGroup SelectionFormula Windows Syntax) ................ 447
PEGetNthParameterField) .... 681 (dBASE for Windows
PEDiscardSaved Data (Delphi
Members (when used with Syntax).................................436 Syntax) ................................ 447
PESetNthParameterField ...... 682 PECheckGroup SelectionFormula
PEDiscardSaved Data (VB
Module Definition (.def) File .... 735 (Delphi Syntax) ....................436 Syntax) ................................ 447
Multiple UFL job PECheckGroup SelectionFormula
PEDiscardSavedData................ 446
considerations..................... 739 (VB Syntax) ..........................436 PEEnableProgressDialog........... 447
PECheckGroupSelection-
O PEEnableProgressDialog (Delphi
Formula ...............................435 Syntax) ................................ 448
Obtaining parameter values from PECheckSelection Formula (dBASE
PEEnableProgressDialog (VB
the parameter block ............ 731 for Windows Syntax)............438 Syntax) ................................ 448
OCX............................................. 8 PECheckSelection Formula (Delphi
PEExportOptions ...................... 662
adding to project ................... 9 Syntax).................................437 PEExportOptions (Delphi Record
changing properties ....... 10, 11 PECheckSelection Formula (VB
Listing) ................................ 668
using ................................... 10 Syntax).................................437 PEExportOptions (VB Type
OLE control.................................. 8 PECheckSelectionFormula ........436
Listing) ................................ 667
adding to project ................... 9 PECloseEngine..........................438 PEExportPrint Window (dBASE for
changing properties ....... 10, 11 PECloseEngine (dBASE for
Windows Syntax) ................ 450
using ................................... 10 Windows Syntax).................439
PEExportPrint Window (Delphi
OnExecute Event...................... 206 PECloseEngine (Delphi Syntax) .439
Syntax) ................................ 450
OnLoadDataFiles Event............ 207 PECloseEngine (VB Syntax) .......438
PEExportPrint Window (VB
PEClosePrintJob ........................439
Syntax) ................................ 450
PEExportPrintWindow.............. 449
Index-3
PEExportTo...............................451 PEGetMargins (Delphi Syntax) . 474 PEGetNSubreportsInSection (VB
PEExportTo (Delphi Syntax) ......451 PEGetMargins (VB Syntax) ....... 474 Syntax) ................................487
PEExportTo (VB Syntax) ............451 PEGetMinimum SectionHeight PEGetNTables ..........................488
PEGetErrorCode .......................452 (Delphi Syntax) ................... 476 PEGetNTables (dBASE for Windows
PEGetErrorCode (dBASE for PEGetMinimum SectionHeight (VB Syntax) ................................489
Windows Syntax) ................453 Syntax)................................ 475 PEGetNTables (Delphi Syntax) .489
PEGetErrorCode (Delphi PEGetMinimumSectionHeight . 474 PEGetNTables (VB Syntax) .......489
Syntax) ................................453 PEGetNDetail Copies (Delphi PEGetNth ParameterField (Delphi
PEGetErrorCode (VB Syntax).....452 Syntax)................................ 477 Syntax) ................................497
PEGetErrorText .........................453 PEGetNDetail Copies (VB PEGetNth ParameterField (VB
PEGetErrorText (Delphi Syntax) 454 Syntax)................................ 477 Syntax) ................................497
PEGetErrorText (VB Syntax) ......454 PEGetNDetailCopies................ 476 PEGetNth ParamInfo (Delphi
PEGetExport Options (Delphi PEGetNFormulas ..................... 477 Syntax) ................................498
Syntax) ................................456 PEGetNFormulas (dBASE for PEGetNth Subreport InSection (VB
PEGetExport Options (VB Windows Syntax) ................ 478 Syntax) ................................502
Syntax) ................................455 PEGetNFormulas (Delphi PEGetNth SubreportIn Section
PEGetExportOptions.................455 Syntax)................................ 478 (Delphi Syntax)....................502
PEGetFormula ..........................456 PEGetNFormulas (VB Syntax)... 478 PEGetNthFormula ....................489
PEGetFormula (Delphi Syntax) .457 PEGetNGroups ........................ 478 PEGetNthFormula (Delphi
PEGetFormula (VB Syntax) .......457 PEGetNGroups (dBASE for Syntax) ................................491
PEGetGraph Options (Delphi Windows Syntax) ................ 479 PEGetNthFormula (VB Syntax) .491
Syntax) ................................461 PEGetNGroups (Delphi Syntax) 479 PEGetNthGroup SortField (Delphi
PEGetGraph Options (VB PEGetNGroups (VB Syntax) ..... 479 Syntax) ................................493
Syntax) ................................460 PEGetNGroupSortFields........... 479 PEGetNthGroup SortField (VB
PEGetGraphData......................458 PEGetNGroupSortFields (dBASE for Syntax) ................................493
PEGetGraphData (Delphi Windows Syntax) ................ 481 PEGetNthGroupSortField .........492
Syntax) ................................459 PEGetNGroupSortFields (Delphi PEGetNthParam .......................494
PEGetGraphData (VB Syntax) ...459 Syntax)................................ 480 PEGetNthParam (Delphi
PEGetGraphOptions.................459 PEGetNGroupSortFields (VB Syntax) ................................495
PEGetGraphText.......................461 Syntax)................................ 480 PEGetNthParam (VB Syntax) ....495
PEGetGraphText (Delphi PEGetNPages........................... 481 PEGetNthParam Info (VB
Syntax) ................................462 PEGetNPages (Delphi Syntax) .. 482 Syntax) ................................498
PEGetGraphText (VB Syntax)....462 PEGetNPages (VB Syntax) ........ 481 PEGetNthParameterField..........496
PEGetGraphType......................463 PEGetNParameterFields ........... 482 PEGetNthParamInfo .................497
PEGetGraphType (Delphi PEGetNParameterFields (Delphi PEGetNthSortField ...................499
Syntax) ................................465 Syntax)................................ 483 PEGetNthSortField(Delphi
PEGetGraphType (VB Syntax)...464 PEGetNParameterFields (VB Syntax) ................................500
PEGetGroup Condition (Delphi Syntax)................................ 482 PEGetNthSortField(VB Syntax)..500
Syntax) ................................467 PEGetNParams ........................ 483 PEGetNthSubreportInSection....501
PEGetGroup Condition (VB PEGetNParams (dBASE for PEGetNthTable Location (Delphi
Syntax) ................................467 Windows Syntax) ................ 484 Syntax) ................................504
PEGetGroup SelectionFormula PEGetNParams (Delphi Syntax) 484 PEGetNthTable Location (VB
(Delphi Syntax)....................469 PEGetNParams (VB Syntax)...... 484 Syntax) ................................503
PEGetGroup SelectionFormula (VB PEGetNSections....................... 484 PEGetNthTable LogOnInfo (Delphi
Syntax) ................................469 PEGetNSections (Delphi Syntax) ................................505
PEGetGroupCondition..............465 Syntax)................................ 485 PEGetNthTable LogOnInfo (VB
PEGetGroupSelectionFormula ..468 PEGetNSections (VB Syntax) .... 485 Syntax) ................................505
PEGetHandle String (Delphi PEGetNSortFields..................... 485 PEGetNthTable SessionInfo (Delphi
Syntax) ................................471 PEGetNSortFields (dBASE for Syntax) ................................507
PEGetHandle String (VB Windows Syntax) ................ 487 PEGetNthTable SessionInfo (VB
Syntax) ................................470 PEGetNSortFields (Delphi Syntax) ................................506
PEGetHandleString...................469 Syntax)................................ 486 PEGetNthTable Type (Delphi
PEGetJobStatus .........................471 PEGetNSortFields (VB Syntax).. 486 Syntax) ................................508
PEGetJobStatus (Delphi Syntax) 472 PEGetNSubreportsInSection..... 487 PEGetNthTable Type (VB
PEGetJobStatus (VB Syntax) ......472 PEGetNSubreportsInSection Syntax) ................................508
PEGetMargins...........................473 (Delphi Syntax) ................... 488 PEGetNthTableLocation ...........502
Index-4
PEGetNthTableLogOnInfo........ 504 PEGraphDataInfo (Delphi Record PEOpenEngine ......................... 536
PEGetNthTableSessionInfo ....... 505 Listing).................................670 PEOpenEngine (dBASE for
PEGetNthTableType................. 507 PEGraphDataInfo (VB Type Windows Syntax) ................ 537
PEGetPrintDate ........................ 509 Listing).................................670 PEOpenEngine (Delphi Syntax) 537
PEGetPrintDate (Delphi Syntax)510 PEGraphOptions.......................671 PEOpenEngine (VB Syntax) ...... 537
PEGetPrintDate (VB Syntax) ..... 510 PEGraphOptions (Delphi Record PEOpenPrintJob ....................... 537
PEGetPrintOptions ................... 510 Listing).................................673 PEOpenPrintJob (dBASE for
PEGetPrintOptions(Delphi PEGraphOptions (VB Type Windows Syntax) ................ 539
Syntax) ................................ 512 Listing).................................672 PEOpenPrintJob (Delphi
PEGetPrintOptions(VB Syntax) . 511 PEGraphTextInfo ......................673 Syntax) ................................ 539
PEGetReportTitle...................... 512 PEGraphTextInfo (Delphi Record PEOpenPrintJob (VB Syntax) .... 538
PEGetReportTitle (Delphi Listing).................................675 PEOpenSubreport .................... 539
Syntax) ................................ 513 PEGraphTextInfo (VB Type PEOpenSubreport (Delphi
PEGetReportTitle (VB Syntax) ... 513 Listing).................................674 Syntax) ................................ 540
PEGetSection Format (Delphi PEHasSavedData ......................526 PEOpenSubreport (VB Syntax).. 540
Syntax) ................................ 516 PEHasSavedData (Delphi PEOutputTo Printer (dBASE for
PEGetSection Format (VB Syntax).................................528 Windows Syntax) ................ 543
Syntax) ................................ 516 PEHasSavedData (VB Syntax) ...527 PEOutputTo Printer (Delphi
PEGetSectionCode ................... 513 PEIsPrintJob Finished (dBASE for Syntax) ................................ 543
PEGetSectionCode(Delphi Windows Syntax).................529 PEOutputTo Printer (VB Syntax)543
Syntax) ................................ 514 PEIsPrintJob Finished (Delphi PEOutputTo Window (dBASE for
PEGetSectionCode(VB Syntax) . 514 Syntax).................................529 Windows Syntax) ................ 548
PEGetSectionFormat................. 515 PEIsPrintJob Finished (VB PEOutputTo Window (Delphi
PEGetSelected Printer (Delphi Syntax).................................529 Syntax) ................................ 547
Syntax) ................................ 518 PEIsPrintJobFinished .................528 PEOutputTo Window (VB
PEGetSelected Printer (VB PEJobInfo..................................676 Syntax) ................................ 547
Syntax) ................................ 518 PEJobInfo (Delphi Record PEOutputToPrinter ................... 541
PEGetSelectedPrinter................ 516 Listing).................................678 PEOutputToWindow................ 543
PEGetSelection Formula (Delphi PEJobInfo (VB Type Listing).......677 PEParameter FieldInfo (Delphi
Syntax) ................................ 520 PELogOffServer.........................529 listing) ................................. 684
PEGetSelection Formula (VB PELogOffServer (Delphi Syntax)531 PEParameter FieldInfo (VB type
Syntax) ................................ 520 PELogOffServer (VB Syntax)......530 listing) ................................. 684
PEGetSelectionFormula............ 519 PELogOnInfo ............................678 PEParameterFieldInfo ............... 680
PEGetSQLQuery ...................... 520 PELogOnInfo (Delphi Record PEParameterInfo....................... 685
PEGetSQLQuery (Delphi Listing).................................680 PEParameterInfo (Delphi Record
Syntax) ................................ 522 PELogOnInfo (VB Type Listing) .679 Listing) ................................ 686
PEGetSQLQuery (VB Syntax).... 521 PELogOnServer.........................531 PEParameterInfo (VB Type
PEGetSubreport Info (Delphi PELogOnServer (Delphi Syntax)533 Listing) ................................ 686
Syntax) ................................ 523 PELogOnServer (VB Syntax)......532 PEPrintControls Showing (Delphi
PEGetSubreport Info (VB PELogOnSQL Syntax) ................................ 549
Syntax) ................................ 523 ServerWithPrivateInfo (Delphi PEPrintControls Showing (VB
PEGetSubreportInfo.................. 522 Syntax).................................535 Syntax) ................................ 549
PEGetVersion ........................... 524 PELogOnSQL PEPrintControlsShowing........... 548
PEGetVersion (dBASE for Windows ServerWithPrivateInfo (VB PEPrintFileOptions ................... 687
Syntax) ................................ 525 Syntax).................................534 PEPrintFileOptions(VB Type
PEGetVersion (Delphi Syntax) .. 525 PELogOnSQLServerWithPrivate- Listing) ................................ 687
PEGetVersion (VB Syntax) ........ 524 Info......................................533 PEPrintOptions......................... 688
PEGetWindow Handle (dBASE for PENextPrint WindowMagnification PEPrintOptions (Delphi Record
Windows Syntax) ................ 526 (dBASE for Windows Listing) ................................ 690
PEGetWindow Handle (Delphi Syntax).................................536 PEPrintOptions (VB Type
Syntax) ................................ 526 PENextPrint WindowMagnification Listing) ................................ 689
PEGetWindow Handle (VB (Delphi Syntax) ....................536 PEPrintReport..................... 17, 549
Syntax) ................................ 526 PENextPrint WindowMagnification PEPrintReport (dBASE for Windows
PEGetWindowHandle .............. 525 (VB Syntax) ..........................536 Syntax) ................................ 552
PEGraphDataInfo ..................... 668 PENextPrintWindow- PEPrintReport (Delphi Syntax) .. 551
Magnification ......................535 PEPrintReport (VB Syntax) ........ 551
Index-5
PEPrintWindow ........................552 PESetGroup SelectionFormula PESetNthTable LogOnInfo (Delphi
PEPrintWindow (dBASE for (dBASE for Windows Syntax) ................................593
Windows Syntax) ................553 Syntax)................................ 576 PESetNthTable SessionInfo (Delphi
PEPrintWindow (Delphi PESetGroup SelectionFormula Syntax) ................................594
Syntax) ................................553 (Delphi Syntax) ................... 576 PESetNthTable SessionInfo (VB
PEPrintWindow (VB Syntax) .....553 PESetGroup SelectionFormula (VB Syntax) ................................594
PESectionOptions..................... 690 Syntax)................................ 576 PESetNthTableLocation ............589
PESectionOptions (Delphi Record PESetGroupCondition .............. 571 PESetNthTableLogOnInfo .........591
Listing) ................................693 PESetGroupSelectionFormula .. 575 PESetNthTableSessionInfo ........593
PESectionOptions (VB Type PESetMargins ........................... 576 PESetPrintDate .........................595
Listing) ...............................692 PESetMargins (dBASE for Windows PESetPrintDate (dBASE for
PESelectPrinter .........................554 Syntax)................................ 578 Windows Syntax) ................596
PESelectPrinter (Delphi Syntax) 556 PESetMargins (Delphi Syntax) .. 578 PESetPrintDate (Delphi Syntax) 596
PESelectPrinter (VB Syntax) ......555 PESetMargins (VB Syntax) ........ 578 PESetPrintDate (VB Syntax) ......596
PESessionInfo ...........................693 PESetMinimum SectionHeight PESetPrintOptions ....................597
PESessionInfo (Delphi Record (dBASE for Windows PESetPrintOptions (Delphi
Listing) ................................695 Syntax)................................ 580 Syntax) ................................598
PESessionInfo (VB Type Listing) 694 PESetMinimum SectionHeight PESetPrintOptions (VB Syntax) .597
PESetDialogParentWindow ......556 (Delphi Syntax) ................... 580 PESetReportTitle.......................598
PESetDialogParentWindow PESetMinimum SectionHeight (VB PESetReportTitle (dBASE for
(Delphi Syntax)....................557 Syntax)................................ 579 Windows Syntax) ................599
PESetDialogParentWindow (VB PESetMinimumSectionHeight .. 579 PESetReportTitle (Delphi
Syntax) ................................557 PESetNDetail Copies (dBASE for Syntax) ................................599
PESetFont .................................557 Windows Syntax) ................ 581 PESetReportTitle (VB Syntax) ....599
PESetFont (dBASE for Windows PESetNDetail Copies (Delphi PESetSection Format (Delphi
Syntax) ................................562 Syntax)................................ 581 Syntax) ................................601
PESetFont (Delphi Syntax) ........562 PESetNDetail Copies (VB PESetSection Format (VB
PESetFont (VB Syntax) ..............561 Syntax)................................ 581 Syntax) ................................601
PESetFormula ...........................563 PESetNDetailCopies................. 580 PESetSection FormatFormula (VB
PESetFormula (dBASE for Windows PESetNth ParameterField (Delphi Syntax) ................................604
Syntax) ................................564 Syntax)................................ 587 PESetSectionFormat..................600
PESetFormula (Delphi Syntax) ..564 PESetNth ParameterField (VB PESetSectionFormatFormula.....601
PESetFormula (VB Syntax) ........564 Syntax)................................ 586 PESetSelection Formula (dBASE for
PESetGraph Options (Delphi PESetNthGroup SortField (dBASE Windows Syntax) ................606
Syntax) ................................567 for Windows Syntax)........... 584 PESetSelection Formula (Delphi
PESetGraph Options (VB PESetNthGroup SortField (Delphi Syntax) ........................ 604, 606
Syntax) ...............................567 Syntax)................................ 583 PESetSelection Formula (VB
PESetGraphData.......................564 PESetNthGroup SortField (VB Syntax) ................................605
PESetGraphData (Delphi Syntax)................................ 583 PESetSelectionFormula.............604
Syntax) ................................566 PESetNthGroupSortField .......... 582 PESetSQLQuery .......................606
PESetGraphData (VB Syntax) ....565 PESetNthParam........................ 584 PESetSQLQuery (dBASE for
PESetGraphOptions..................566 PESetNthParam (dBASE for Windows Syntax) ................608
PESetGraphText........................568 Windows Syntax) ................ 586 PESetSQLQuery (Delphi
PESetGraphText (Delphi PESetNthParam (Delphi Syntax)585 Syntax) ................................607
Syntax) ................................569 PESetNthParam (VB Syntax) ..... 585 PESetSQLQuery (VB Syntax).....607
PESetGraphText (VB Syntax).....569 PESetNthParameterField .......... 586 PEShow Functions....................608
PESetGraphType.......................569 PESetNthSortField .................... 587 PEShow Functions (dBASE for
PESetGraphType (Delphi PESetNthSortField (dBASE for Windows Syntax) ................610
Syntax) ................................571 Windows Syntax) ................ 589 PEShow Functions (Delphi
PESetGraphType (VB Syntax)....570 PESetNthSortField (Delphi Syntax) ................................609
PESetGroup Condition (dBASE for Syntax)................................ 589 PEShow Functions (VB Syntax) .609
Windows Syntax) ................575 PESetNthSortField (VB Syntax) . 588 PEShowNthPage.......................610
PESetGroup Condition (Delphi PESetNthTable Location (Delphi PEShowNthPage (Delphi
Syntax) ................................574 Syntax)................................ 590 Syntax) ................................611
PESetGroup Condition (VB PESetNthTable Location (VB PEShowNthPage (VB Syntax)....611
Syntax) ................................574 Syntax)................................ 590
Index-6
PEShowPrint Controls (dBASE for PrintFileCharSepQuote before using in your
Windows Syntax) ................ 613 Property.........................91 , 168 application........................... 3
PEShowPrint Controls (Delphi PrintFileCharSepSeparator creating interface for.............. 4
Syntax) ................................ 613 Property.........................91 , 169 creating reports for ................ 4
PEShowPrint Controls (VB PrintFileLinesPerPage Property ...92 distributing applications ...... 35
Syntax) ................................ 613 PrintFileName Property ......93 , 170 features.................................. 2
PEShowPrintControls................ 612 PrintFileODBCPassword.............93 introduction to....................... 2
PEStartPrintJob ......................... 613 PrintFileODBCSource.................94 using ..................................... 4
PEStartPrintJob (dBASE for PrintFileODBCTable...................95 Report Engine API
Windows Syntax) ................ 615 PrintFileODBCUser ....................95 coding a custom print link ... 21
PEStartPrintJob (Delphi Syntax). 614 PrintFileType Property ........96 , 170 custom print link ................. 21
PEStartPrintJob (VB Syntax)....... 614 PrintFileUseRptDateFmt declarations......................... 16
PESubreportInfo ....................... 695 Property.........................98 , 173 error handling...................... 30
PESubreportInfo (Delphi Record PrintFileUseRptNumberFmt PEPrintReport ...................... 17
Listing) ................................ 696 Property.........................99 , 173 print-only link...................... 17
PESubreportInfo (VB Type PrintMonth Property .........101, 174 REC Library ......................... 14
Listing) ................................ 696 print-only link.............................17 sample code ........................ 34
PETableLocation ...................... 696 PrintReport Method ..................100 sample custom print link ..... 25
PETableLocation (Delphi Record PrintWindow Method ...............202 structures............................. 35
Listing) ................................ 698 PrintYear Property ............101, 175 using ................................... 16
PETableLocation (VB Type programming Report Engine Class Library........ 13
Listing) ................................ 697 Report Engine API ................15 ReportDisplayPage
PETableType ............................ 698 programming a custom print link21 Property ...................... 105, 177
PETableType (Delphi Record Programming the UFL...............721 ReportFileName Property......... 105
Listing) ................................ 700 ProgressDialog Property ...102, 175 ReportLatestPage Property 106, 178
PETableType (VB Type Listing) . 700 properties ReportName Property .............. 178
PETestNthTable Connectivity changing ................................7 ReportPrinterSetup Property ..... 179
(dBASE for Windows changing for ActiveX reports
Syntax) ................................ 617 Control .........................10, 11 creating for Report Engine ..... 4
PETestNthTable Connectivity changing VCL ......................13 ReportSource Property ............. 107
(Delphi Syntax) ................... 616 properties list ReportStartPage Property.. 107, 180
PETestNthTable Connectivity (VB changing properties on ..........7 ReportTitle Property ................. 180
Syntax) ................................ 616 Purpose of the function.............719 ReportWindowHandle Method 203
PETestNthTableConnectivity .... 615 Resetting Array Properties ........ 207
PEZoomPreview Window (dBASE R Resetting Sort Array Properties . 208
for Windows Syntax) ........... 618 REAPI .........................................15 Resetting TCrpe String
PEZoomPreview Window (Delphi coding a custom print link ...21 Properties............................ 208
Syntax) ................................ 618 custom print link ..................21 Retrieving report data with Visual
PEZoomPreview Window (VB declarations .........................16 Basic ..................................... 44
Syntax) ................................ 618 error handling ......................30 Return Types............................ 720
PEZoomPreviewWindow ......... 617 PEPrintReport .......................17 Returning User Defined Errors.. 730
Picture Function - a sample UFL print only link ......................17 runtime
function .............................. 732 REC Library ..........................14 changing custom control
PrintControls Property .............. 166 sample code ........................34 properties............................. 8
PrintDay Property............... 90 , 167 sample custom print link ......25 changing VCL properties ..... 13
PrintEnded Property ................. 168 structures .............................35 runtime properties
PrinterCollation Property.... 85 , 159 using ....................................16 ActiveX Control ................... 11
PrinterCopies Property ....... 86 , 160 REC Library ................................13
PrinterDriver Property ........ 87 , 160 RecordsPrinted Property ...103, 176 S
PrinterMode Property ............... 161 RecordsRead Property ......103, 176 sample code for Report Engine
PrinterName Property......... 87 , 163 RecordsSelected Property .104, 177 API........................................ 34
PrinterPort Property............ 88 , 164 Report Engine sample custom print link ............ 25
PrinterSelect Method................ 132 adding to application .............4 Section Map............................. 430
PrinterStartPage Property.... 89 , 165 API.......................................15 SectionFont Property................ 181
PrinterStopPage Property.... 89 , 166 SectionFormat Property.... 109, 182
Index-7
SectionLineHeight using the Report Engine API....... 16 Visual dBASE
Property ...................... 111, 184 using the VCL ............................ 12 Report Engine API................ 16
SectionMinHeight UXDDiskOptions..................... 701 sample REAPI code.............. 34
Property ...................... 112, 185 UXDDiskOptions (Delphi Record
SelectionFormula Property113, 186 Listing) ................................ 701 W
SessionHandle Property............114 UXDMAPIOptions ................... 702 Where to open/close the Report
SetFocus Method......................203 UXDMAPIOptions(Delphi Record Engine using Visual Basic API
setting properties at runtime .........8 Listing) ................................ 703 calls ...................................... 40
Setting Up a UFL Project ..........722 UXDPostFolder Options (Delphi WindowBorderStyle
ShowFirstPage Method .............204 Record Listing) .................... 705 Property ...................... 120, 192
ShowLastPage Method .............204 UXDPostFolderOptions ........... 703 WindowControlBox
ShowNextPage Method ............205 UXDVIMOptions ..................... 705 Property ...................... 121, 192
ShowPage Method ...................205 UXDVIMOptions (Delphi Record WindowControls......................121
ShowPreviousPage Method ......206 Listing) ................................ 706 WindowControls Property 121, 193
SortFields Property ........... 115, 187 UXFChar SeparatedOptions (Delphi WindowHeight Property .. 122, 193
SQLQuery Property .......... 117, 189 Record Listing) .................... 708 WindowLeft Property ....... 123, 194
Status Property ................. 118, 190 UXFCharSeparatedOptions ...... 707 WindowMaxButton
StoredProcParam Property 118, 190 UXFCommaTab SeparatedOptions Property ...................... 123, 195
structure CRPEExportOptions ...217 (Delphi Record Listing) ....... 709 WindowMinButton
structure CRPEGraphDataInfo ..225 UXFCommaTabSeparated- Property ...................... 124, 195
structure CRPEGraphOptions ...229 Options............................... 708 WindowParentHandle
structure CRPEGraphTextInfo ...227 UXFDIFOptions ....................... 709 Property ...................... 125, 196
structure CRPEJobInfo...............211 UXFDIFOptions (Delphi Record WindowState Property ..... 126, 196
structure CRPELogOnInfo .........210 Listing) ................................ 710 WindowTitle Property ...... 127, 197
structure CRPEParameterField- UXFHTML3 Options (Delphi WindowTop Property....... 127, 198
Info .....................................231 Record Listing) .................... 711 WindowWidth Property ... 128, 198
structure CRPEParameterInfo ....234 UXFHTML3Options................. 711 Working with section codes .....428
structure CRPEPrintOptions ......215 UXFODBCOptions .................. 712 Wrong syntax ............................. 41
structure CRPESectionOptions..222 UXFODBCOptions(Delphi Record
structure CRPESessionInfo ........213 Listing) ................................ 712 Z
structure CRPESubreportInfo.....235 UXFPaginatedTextOptions....... 713
ZoomMagnification Method.....199
structure CRPETableLocation....214 UXFPaginatedTextOptions (Delphi
ZoomPreviewWindow Property200
structure CRPETableType .........212 Record Listing) .................... 713
structures UXFRecordStyle Options (Delphi
Report Engine API................35 Record Listing) .................... 715
UXFRecordStyleOptions .......... 714
T
TCrpe Component....................134 V
TCrpePrinterSetup Class ...........134 VBX ............................................. 5
TermForJob Function................729 adding to project ................... 6
changing properties............7, 8
U using ..................................... 7
UFJOB Modules .......................737 VCL ........................................... 11
UFJOB.C ..................................737 adding to project ................. 11
UFJOB.H..................................738 changing properties............. 13
UFL Function Implementation ..730 using ................................... 12
user defined types ...................... 35 Visual Basic
User Function Libraries - An Report Engine API ............... 16
Overview ............................717 sample REAPI code ............. 34
user interface Visual Component Library ......... 11
creating for Report Engine......4 adding to project ................. 11
UserName Property.......... 119, 191 changing properties............. 13
using the ActiveX Control...........10 using ................................... 12
Using the Crystal Report Engine ...4 Visual Component Library (VCL) 11
using the custom control ..............7
Index-8