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

Crpe1->SectionFormat->Retrieve();

Crpe1->SectionFormat->Section = "D";

Crpe1->SectionFormat->BackgroundColor = clRed;

//The default array property Item can also be used

Crpe1->SectionFormat->Item[1]->BackgroundColor = clGreen;

//Run the Report

Crpe1->Execute();

Known Problems

The following topics are discussed in this section.

Retrieving ParamFields from a Subreport, Page 226

DialogParent and Temporary Forms, Page 226

Retrieving ParamFields from a Subreport

There is a known problem with the CRPE32.DLL of Crystal 7 when attempting to retrieve ParamFields when a Subreport is the current Report (that is, Subreports[n], where n is a number greater than zero). This does not prevent access to Subreport ParamFields, since retrieving Subreports from the main Report (Subreports[0]) will retrieve the Subreport Parameters as well. The only time this will be a problem is if a Subreport is being run as a separate Report (Crpe1.Subreports.SubExecute := True), and the Subreports class is pointing to a Subreport when the ParamFields.Retrieve method is called. If you need to do this, do not use the ParamFields.Retrieve method, simply build your ParamFields items manually with the Add method.

DialogParent and Temporary Forms

If the DialogParent property is set to a temporary Form, the Report is run, and then the temporary Form is destroyed, attempting to run the Report a second time will cause an Access Violation in CRPE32.DLL. This is because the CRPE stores the address of the DialogParent as long as the PrintJob is open. There seems to be no way, at this time, to set the CRPE's Dialog Parent memory location back to nil. There are a number of ways around this:

1Set the DialogParent property of the VCL to a valid Form before running the Report a second time.

2Close the Print Job (Crpe1.CloseJob) and open it again to run it the second time.

Seagate Crystal Visual Component Library

226

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