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

CRPEngine::LogOffServer

This method closes an existing connection to a SQL server. Connection information is provided through the class CRPELogOnInfo, Page 470.

Syntax

LogOffServer(dllName CHAR (*), const CRPELogOnInfo logOnInfo) RETURNING BOOLEAN

Parameters

dllName

Specifies the name of the Seagate Crystal Reports DLL for the server or password

 

protected non-SQL table you want to log on to.

 

 

logOnInfo

Specifies a pointer to a CRPELogOnInfo class.

Returns

TRUE if the call is successful.

FALSE if the call fails.

Related Topics

PELogOffServer, Volume 2, Chapter 1

CRPEngine::LogOnServer

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 class CRPELogOnInfo (page 470).

Syntax

LogOnServer (dllName CHAR(*), logOnInfo CRPELogOnInfo) RETURNING BOOLEAN;

Parameters

dllName

Specifies the name of the Seagate Crystal Reports DLL for the server or password

 

protected non-SQL table you want to log on to.

logOnInfo

Specifies a pointer to class CRPELogOnInfo (page 470).

 

 

Crystal Class Library for NewEra Reference

399

Return Value

TRUE if the call is successful.

FALSE if the call fails.

Related Topics

PELogOffServer, Volume 2, Chapter 1

CRPEngine::LogOnSQLServerWithPrivateInfo

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 LogOff call from disconnecting an application’s existing connection to the Server. See Remarks below.

Syntax

LogOnSQLServerWithPrivateInfo (dllName CHAR (*), FOREIGN privateInfo) RETURNING BOOLEAN

Parameters

dllName

Specifies the name of the Seagate 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 file name “PDSODBC.DLL”. For more

 

information on possible database DLLs, refer to Runtime File Requirements online Help.

 

 

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

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.

Crystal Class Library for NewEra Reference

400

To obtain an HDBC for an ODBC connection, use the following function calls (see the ODBC SDK 2.0 manual for more information):

Function Call

Description

 

 

 

 

SQLAllocEnv

Initializes the ODBC call level interface and allocates memory for an

 

environment handle.

 

 

SQLAllocConnect

Returns an ODBC HDBC. To obtain an HDBC for a Q+E Library connection, use

 

the following function calls (see the InterSolv DataDirect Developer’s Toolkit

 

for more information).

 

 

qeConnect

Opens a connection to the server.

 

 

qeGetODBCHdbc

Returns the ODBC HDBC.

 

 

Returns

TRUE if the call is successful.

FALSE if the call fails.

CRPEngine::Open

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.

Syntax

Open() RETURNING BOOLEAN

Returns

TRUE if the Crystal Report Engine was opened successfully.

FALSE if something went wrong.

Related Topics

constructor CRPEngine::CRPEngine, Page 395

PEOpenEngine, Volume 2, Chapter 1

Crystal Class Library for NewEra Reference

401

CRPEngine::OpenJob

This method opens the report specified by reportFileName. A pointer to a CRPEJob object is returned. Print job attributes may be referenced through this object.

Syntax

OpenJob (reportFileName CHAR(*)) RETURNING CRPEJob

Parameter

reportFileName

The name and path (if necessary) of the report file being opened for the specified

 

print job.

 

 

Returns

CRPEJob object for the opened print job.

Related Topics

PEOpenPrintJob, Volume 2, Chapter 1

CRPEngine::PrintReport

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.

Syntax

PrintReport (reportFilePath CHAR (*), toPrinter BOOLEAN : TRUE, toWindow BOOLEAN : FALSE, title CHAR (*) : “Crystal Report”, left SMALLINT : 0,top SMALLINT : 0, width SMALLINT : 0, height SMALLINT : 0, style INTEGER : 0, parentWindow ixWindow : NULL) RETURNING SMALLINT

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.

Crystal Class Library for NewEra Reference

402

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