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

Availability

Design Time; Runtime

Related Report Engine Functions

PEOutputToWindow, Volume 2, Chapter 1

ActiveX Controls Methods

The following Methods are discussed in this section.

FetchSelectionFormula, Page 267

GetNSubreports, Page 267

GetNthSubreportName, Page 268

LogoffServer, Page 268

LogonServer, Page 269

PageCount, Page 270

PageFirst, Page 270

PageLast, Page 270

PageNext, Page 271

PagePrevious, Page 271

PageShow, Page 272

PageZoom, Page 272

PageZoomNext, Page 273

PrinterSelect, Page 273

PrintReport, Page 274

ReplaceSelectionFormula, Page 274

Reset, Page 275

RetrieveDataFiles, Page 275

RetrieveLogonInfo, Page 276

RetrieveSQLQuery, Page 276

RetrieveStoredProcParams, Page 277

SpecifyDataSourceField, Page 277

Crystal ActiveX Control Reference

266

FetchSelectionFormula

FetchSelectionFormula returns the selection formula from the current report.

Syntax

[form.]Report.FetchSelectionFormula

For example:

SelectionFormula$= CrystalReport1.FetchSelectionFormula

«Retrieves the selection formula from CrystalReport1.»

Remarks

This method does not populate SelectionFormula, Page 241, and it does not conflict with setting the property. Both the method and the property can be used in the same code.

Availability

Runtime only

GetNSubreports

GetNSubreports looks at the report specified in ReportFileName, Page 233, and returns the number of subreports in that report.

Syntax

[form.]Report.GetNSubreports

For example:

Number=CrystalReport1.GetNSubreports

«Returns the number of subreports in CrystalReport1.»

Remarks

Zero indexed. Thus, if the function returns 2, that indicates that there are three subreports, the first one being subreport 0.

NOTE: If you are currently using the VBX control in your application, you will not be able to print individual subreports.

Crystal ActiveX Control Reference

267

GetNthSubreportName

GetNthSubreportName looks at the report specified in the ReportFileName property and returns a string which is the name of the nth subreport in that report.

Syntax

[form.]Report.GetNthSubreportName (SubreportNum%)

For example:

SubreportName=CrystalReport1.GetNthSubreportName (2)

«Returns the name of the third subreport in CrystalReport1.»

Remarks

The valid range for the parameter is 0 to n-1, where n is the number you get back from GetNSubreports.

NOTE: If you are currently using the VBX control in your application, you will not be able to print individual subreports.

LogoffServer

LogoffServer terminates the specified database connection established earlier with the LogonServer, Page 269.

Syntax

[form.]Report.LogoffServer (connectionId%, boolean allConnections)

For example:

CrystalReport1.LogoffServer (1, False)

«Terminates database connection 1 and only that connection.»

Parameters

connectionId

Integer value that specifies a specific database connection established earlier with

 

LogonServer, Page 269. If you have set allConnections to True, connectionId should be

 

set to 0.

allConnections

Boolean value that specifies whether or not to terminate ALL database connections

 

that have been established with the LogonServer method.

 

True = Terminate all connections.

 

False = Terminate only the specified connection.

 

 

Crystal ActiveX Control Reference

268

LogonServer

LogonServer logs on to the specified server and returns a unique connection id which can be used to log off of this server using the LogoffServer, Page 268.

Syntax

[form.]Report.LogonServer (dllName$, ServerName$, DatabaseName$, UserID$, Password$)

For example:

connectionId% = CrystalReport1.LogonServer (“pdsodbc.dll”, “Accounting”, “Administration”, “bobg”, “bigboard”)

«Connects to the “Administration” database via the “Accounting” data source using the user ID “bobg” and the password “bigboard”.»

Parameters

dllName

Specifies the name of the Seagate 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.

 

 

ServerName

Specifies the logon name for the server used to create the report. *For ODBC, use the

 

data source name.

DatabaseName

Specifies the logon name for the database used to create the report.

 

 

UserID

Specifies the user ID necessary to log on to the server.

 

 

Password

Specifies the password necessary to log on to the server. When you are using this

 

structure to retrieve information using PEGetNthTableLogOnInfo, Volume 2,

 

Chapter 1, the password parameter is undefined.

 

 

Crystal ActiveX Control Reference

269

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