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

If SendOnExecute is set to False, each Sub-class property, and each property that does not belong to a Subclass, must be sent manually to the Print Engine using the Send method before the Execute method is called. This feature is provided mainly for debugging purposes.

SendOnExecute Example

The code below illustrates the SendOnExecute property, although setting it to True is not normally necessary as this is it's default state:

Crpe1.ReportName := 'C:\Company.rpt';

Crpe1.SendOnExecute := True;

Crpe1.Output := toWindow;

Crpe1.Execute;

SessionInfo

Declaration

property SessionInfo: TCrpeSessionInfo;

Type

TCrpeSessionInfo = class(TPersistent)

Description

SessionInfo contains the properties that set the specified Session Information when opening a Microsoft Access Table that has security. In Microsoft Access 95 and later, an Access database can have Session security (also known as User-Level security), Database-Level security, or both.

SessionInfo works on a table-by-table basis, so after the Retrieve method is called, there is one SessionInfo item in the SessionInfo object for each table in the Report.

The Propagate property can be used to apply the property values from the first item to the other items in the SessionInfo object, so it is not necessary to set each one with UserID and Password.

The UserID property specifies the user ID value needed for logging on to the system.

If the Access database contains only Session security, simply pass the Session Password to the UserPassword property.

If the Access database contains database-level security, put the Session Password in the UserPassword property, and the Database-Level Password in the DBPassword property.

The Handle property specifies the handle to the current MS Access session. If the Handle property is not set (the default value is 0), the Crystal Report Engine uses the UserID and UserPassword settings. In all other cases it uses the Handle value.

The default array property, Item, or the ItemIndex property, can be used to navigate through the SessionInfo object.

VCL Reference

105

SessionInfo Example

The code example below shows how to retrieve the SessionInfo and then loop through the items to set the UserID and UserPassword before running the Report:

var

cnt: integer; begin

Crpe1.ReportName := 'C:\Company.rpt'; Crpe1.SessionInfo.Retrieve;

for cnt := 0 to (Crpe1.SessionInfo.Count - 1) do begin

Crpe1.SessionInfo[cnt].UserID := 'Bond'; Crpe1.SessionInfo[cnt].UserPassword := '007';

end;

Crpe1.Output := toWindow; Crpe1.Execute;

end;

SessionInfo Properties

SessionInfo DBPassword property, Page 602

SessionInfo Handle property, Page 602

SessionInfo Item property, Page 603

SessionInfo ItemIndex property, Page 603

SessionInfo Propagate property, Page 604

SessionInfo Table property, Page 605

SessionInfo UserID property, Page 605

SessionInfo UserPassword property, Page 606

SessionInfo Methods

SessionInfo Add method, Page 607

SessionInfo Clear method, Page 607

SessionInfo CopyFrom method, Page 608

SessionInfo Count method, Page 609

SessionInfo Create method, Page 609

SessionInfo Delete method, Page 610

SessionInfo Destroy method, Page 610

SessionInfo Retrieve method, Page 610

SessionInfo Send method, Page 611

VCL Reference

106

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