Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
192
Добавлен:
11.05.2015
Размер:
4.96 Mб
Скачать

constructor CRPEngine::CRPEngine

This is the constructor for the class. If open is true, the actual Seagate 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 CRPEngine::Open, Page 401.

Constructor Syntax

CRPEngine (v_open BOOLEAN : FALSE);

Parameter

v_open

Indicates whether or not the Crystal Report Engine should be opened when the

 

CRPEngine object is created.

class CRPEngine Methods

The following methods are discussed in this section.

CRPEngine::CanClose, Page 396

CRPEngine::Close, Page 396

CRPEngine::GetEngineStatus, Page 396

CRPEngine::GetErrorCode, Page 397

CRPEngine::GetErrorText, Page 397

CRPEngine::GetNPrintJobs, Page 398

CRPEngine::GetVersion, Page 398

CRPEngine::LogOffServer, Page 399

CRPEngine::LogOnServer, Page 399

CRPEngine::LogOnSQLServerWithPrivateInfo, Page 400

CRPEngine::Open, Page 401

CRPEngine::OpenJob, Page 402

CRPEngine::PrintReport, Page 402

Crystal Class Library for NewEra Reference

395

CRPEngine::CanClose

Use CRPEngine::CanClose to Check to see whether or not the Crystal Report Engine is busy. Errors can occur in your application or on a system if you attempt to close the Crystal Report Engine while it is processing a print job. Use this method before attempting to close the Crystal Report Engine in an application (for example, when the user tries to exit) to determine if the Report Engine can be closed safely.

Syntax

CanClose () RETURNING BOOLEAN

Returns

TRUE if the Crystal Report Engine can be closed safely.

FALSE if the Crystal Report Engine is still busy.

Related Topics

CRPEngine::CanClose, Volume 2, Chapter 2

PECanCloseEngine, Volume 2, Chapter 1

CRPEngine::Close

This method closes the Crystal Report Engine.

Syntax

Close() RETURNING VOID

Related Topics

PECloseEngine, Volume 2, Chapter 1

CRPEngine::GetEngineStatus

This method may be used to get the current engine status.

Syntax

GetEngineStatus() RETURNING SMALLINT

Crystal Class Library for NewEra Reference

396

Returns

One of the following values of the Status enumerated type indicating the current status of the Crystal Report Engine.

Value

Description

 

 

 

 

engineOpen

The Crystal Report Engine is currently open.

engineClosed

The Crystal Report Engine has been closed, or is not yet open.

 

 

engineMissing

No Crystal Report Engine is available. Make sure the Crystal Report Engine DLL is

 

located in a directory that appears in your PATH.

 

 

CRPEngine::GetErrorCode

This method returns the current error code of the Crystal 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.

Syntax

GetErrorCode () RETURNING SMALLINT

Returns

Returns the current Crystal Report Engine Error Codes (page 477).

Returns 0 if no error has occurred.

Related Topics

PEGetErrorCode, Volume 2, Chapter 1

CRPEngine::GetErrorText

This method returns a descriptive Crystal Report Engine error message.

Syntax

GetErrorText () RETURNING ixString

Returns

A ixString object containing the text for the current error code.

Related Topics

PEGetErrorText, Volume 2, Chapter 1

Crystal Class Library for NewEra Reference

397

CRPEngine::GetNPrintJobs

This method returns the number of print job (CRPEJob) objects that currently exist for the current CRPEngine object.

Syntax

GetNPrintJobs () RETURNING SMALLINT;

Returns

Returns the number of CRPEJob objects currently open.

Returns -1 if an error occurs.

CRPEngine::GetVersion

This method returns the version number of the Crystal 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 Crystal 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 Crystal Report Engine with the older version earlier in the path than the new version.

Syntax

GetVersion (versionRequested SMALLINT) RETURNING SMALLINT

Parameter

versionRequested

Specifies whether the version number of the Crystal Report Engine or the Report

 

Engine DLL is being requested. Possible values are:

 

 

 

 

 

 

 

Value

Meaning

 

 

 

 

 

 

 

PEP_GV_DLL

Returns the version of the DLL.

 

 

 

 

PEP_GV_ENGINE

Returns the version of the Crystal Report Engine.

 

 

 

Returns

The version number of the currently used Crystal Report Engine or Report Engine DLL.

Related Topics

PEGetVersion, Volume 2, Chapter 1

Crystal Class Library for NewEra Reference

398

Соседние файлы в папке crystal