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

NOTE: The group sort field entry must follow the sort direction sign (+ or -) with no intervening space. NOTE: To find the correct syntax for any group in your report using Seagate Crystal Reports for Visual Basic:

choose the Formula Field command from the Insert menu,

enter any formula name in the Insert Formula dialog box when it appears,

click the scroll button on the Fields list in the Formula Editor when it appears, and

double-click the group field of interest.

Seagate Crystal Reports enters the group field name in the Formula text box. Use the name and syntax from that text box when constructing your group sort field string.

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

Data Type

Array of strings

Availability

Runtime

Related Report Engine Functions

PESetNthGroupSortField, Volume 2, Chapter 1

LastErrorNumber

LastErrorNumber specifies the error code for the last runtime error.

Syntax

[form.]Report.LastErrorNumber

For example:

'If error occurs, go to Error Handler On Error GoTo ErrorHandler

ErrorHandler:

MsgBox CrystalReport1.LastErrorNumber

«If an error occurs, this code calls up a message box that displays the error number.»

Crystal ActiveX Control Reference

203

Remarks

LastErrorNumber is a runtime-only property.

This property/method is available for subreports.

NOTE: LastErrorNumber must come after the Action call in order to display relevant values. After you have printed your report, you can refer to this property to get an error number (if any). If there was no error in printing, LastErrorNumber = 0.

Data Type

Integer

Availability

Runtime

Related Report Engine Functions

PEGetErrorCode, Volume 2, Chapter 1

LastErrorString

LastErrorString specifies the error string for the last runtime error.

Syntax

[form.]Report.LastErrorString

For example:

'If error occurs, go to Error Handler On Error GoTo ErrorHandler

ErrorHandler:

MsgBox CrystalReport1.LastErrorString

«If an error occurs, this code calls up a message box that displays the error string.»

Remarks

LastErrorString is a runtime-only property.

This property/method is available for subreports.

NOTE: LastErrorString must come after the Action call in order to display relevant values. After you have printed your report, you can refer to this property to get an error string (if any). If there was no error in printing, LastErrorNumber = 0.

Crystal ActiveX Control Reference

204

Data Type

String

Availability

Runtime

Related Report Engine Functions

PEGetErrorCode, Volume 2, Chapter 1

PEGetErrorText, Volume 2, Chapter 1

LogOnInfo

LogOnInfo specifies the information required to log on to one or more SQL servers or password-protected databases.

Syntax

[form.]Report.LogOnInfo(ArrayIndex)[ = Name;UserID;Password;DatabaseQualifier$]

For example:

CrystalReport1.LogOnInfo[0] = “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”.»

CrystalReport1.LogOnInfo[0] = dsn=;uid=;pwd=bigboard;dsq=?

«Connects to a password-protected Paradox database. All that is being passed is the password bigboard.»

Remarks

Use the LogOnInfo property when the report connects to multiple data sources that require different log on information. If the report connects to only a single ODBC data source or SQL server, and only a single set of log on information is required, simply pass 0 as the array index, or Connect, Page 180, can be used instead.

Use a separate line of code for each table for which you want to change the logon info.

The order of tables in the array must conform to the order of tables in the report. (You can use the Database|Set Location command to determine the order of tables in the report.)

Crystal ActiveX Control Reference

205

The first table in the report is array index (0), the second file is (1), etc. For example, to change the logon information of the first and third tables in a report to the NEW server, use the following syntax:

CrystalReport1.LogOnInfo(0) = “DSN = NEW;UID = 734;PWD = bigboard;DSQ = Administration1”CrystalReport1.LogOnInfo(2) = “DSN = NEW;UID = 734;PWD = bigboard;DSQ = Administration2”

LogOnInfo is an array property that is available at runtime only.

Enter the parameters necessary to log on to each SQL server table that you need to change information for in 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.

The database qualifier parameter (DSQ) is required only when it is applicable to the ODBC/SQL driver you are using. If your DBMS does not use the database concept, you do not need to specify the DSQ parameter.

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.

If you are connecting to an SQL or other password protected database directly, without going through ODBC, use the name of the SQL server for the DSN parameter.

RetrieveLogonInfo, Page 276, can be used to populate this property with log on information automatically.

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

Data Type

Array of strings

Availability

Runtime

MarginBottom

MarginBottom specifies the bottom margin for the specified report.

Syntax

[form.]Report.MarginBottom[=MarginSetting%]

Crystal ActiveX Control Reference

206

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