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

Description

The CopyFrom method copies the SummaryInfo property values from another TCrpeSummaryInfo object. It is similar to Delphi's Assign method. It is useful for transferring or temporary storage of values.

Example

The following example copies all the SummaryInfo property values to a temporary TCrpeSummaryInfo object:

var

tempSummaryInfo : TCrpeSummaryInfo; begin

tempSummaryInfo := TCrpeSummaryInfo.Create; tempSummaryInfo.CopyFrom(Crpe1.SummaryInfo); {...later, when finished with the temp object...} tempSummaryInfo.Free;

end;

SummaryInfo Create method

Declaration

constructor Create;

Description

The Create method is used internally in the Crystal component and does not need to be called in code.

SummaryInfo Destroy method

Declaration

destructor Destroy; override;

Description

The Destroy method is used internally in the Crystal component and does not need to be called in code.

NOTE: The TCrpe component is responsible for creating and freeing all of the sub-classes that belong to it. The only time you would want to be concerned with doing this is if you are creating a temporary object to store data from the TCrpe using the CopyFrom method that is available from the sub-class or the CopyFrom method that is available from the main TCrpe class.

VCL Reference

666

SummaryInfo Retrieve method

Declaration

function Retrieve: boolean;

Description

The Retrieve method obtains the SummaryInfo information from the Report. SummaryInfo only applies to the main Report, not to Subreports, and is only available with Crystal Reports 6 or higher. Returns True if the call succeeded.

NOTE: Attempting to Retrieve SummaryInfo from a Report where the Comments are larger than 512 characters can cause an error in the Print Engine. This is a known problem (at the time of this writing), and should be addressed in a future release (> 6.0).

Example

This code sample retrieves the SummaryInfo from a Report:

Crpe1.ReportName := 'Company.rpt';

Crpe1.SummaryInfo.Retrieve;

SummaryInfo Send method

Declaration

function Send: boolean;

Description

The Send method sends the SummaryInfo values to the Crystal Reports Print Engine. This method is called automatically when the Execute method is called, provided that SendOnExecute is set to True.

It is strongly recommended that you leave SendOnExecute to True, and let the Crystal Reports component send the values to the Print Engine. If you set the SendOnExecute property to False, each Sub-class and each property that does not belong to a Sub-class must be manually sent before calling the Execute method. This feature is mainly provided for debugging purposes.

Example

In this example, the SummaryInfo settings are sent from the Crystal component to the Crystal Reports Print Engine DLL. This is normally handled automatically in the Execute method:

Crpe1.SummaryInfo.Send;

VCL Reference

667

Tables Properties

Tables DescriptiveName property

Declaration

property DescriptiveName: string;

Description

DescriptiveName is a read-only, run-time property which contains a description of the database driver being used by Crystal Reports to connect to the Table, for example:

xBase

IDAPI Database DLL

Oracle7 SQL

ODBC - Interbase

This property goes along with TableType and DLLName to provide a complete description of the database driver. These properties will only have values after the Retrieve method is called.

Example

The following example illustrates the use of the DescriptiveName property:

Crpe1.ReportName := 'C:\Company.rpt'; {Retrieve the Tables} Crpe1.Tables.Retrieve;

{Loop through Tables obtaining descriptive information} for cnt := 0 to (Crpe1.Tables.Count - 1) do

begin

ListBox1.Items.Add(Crpe1.Tables[cnt].TableType);

ListBox2.Items.Add(Crpe1.Tables[cnt].DLLName);

ListBox3.Items.Add(Crpe1.Tables[cnt].DescriptiveName); end;

Tables DLLName property

Declaration

property DLLName: string;

VCL Reference

668

Description

DLLName is a read-only, run-time property which contains the name of the database driver being used by Crystal Reports to connect to the Table, for example:

pdbxbse.dll

pdbbde.dll

pdsora7.dll

pdsodbc.dll

Note that the 16-bit naming convention is used, even though the DLL's may be 32-bit (P2BXBSE.DLL, etc.). This property goes along with TableType and DescriptiveName to provide a complete description of the database driver. These properties will only have values after the Retrieve method is called.

Example

The following example illustrates the use of the DLLName property:

Crpe1.ReportName := 'C:\Company.rpt'; {Retrieve the Tables} Crpe1.Tables.Retrieve;

{Loop through Tables obtaining descriptive information} for cnt := 0 to (Crpe1.Tables.Count - 1) do

begin

ListBox1.Items.Add(Crpe1.Tables[cnt].TableType);

ListBox2.Items.Add(Crpe1.Tables[cnt].DLLName);

ListBox3.Items.Add(Crpe1.Tables[cnt].DescriptiveName); end;

Tables Item property

Declaration

property Item[const nIndex: integer]: TCrpeTables;

Description

The Item property is a default array property. It is read-only, and only available at runtime. It's primary use is to provide an easy way to navigate through the various items stored in the Tables object, allowing the object to be treated like an array.

Item is a default property, so it does not need to be specified when using the subscript: Tables[2] is the same as Tables.Item[2].

Item returns a reference to itself, so the Tables properties can be used right after the subscript: Tables[2].Name := 'MyTable.dbf';

VCL Reference

669

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