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

ReportOptions ConvertDateTimeType property

Declaration

property ConvertDateTimeType: TCrDateTimeType;

Type

TCrDateTimeType = (dtConvertToString, dtConvertToDate, dtKeepAsDateTime, dtDefault);

Description

The ConvertDateTimeType property specifies how DateTime fields will be treated in a Report: as DateTime values, as DateTime String values, or just as Date (no Time).

Example

This example sets the ConvertDateTimeType property of ReportOptions:

Crpe1.ReportName := 'C:\Company.rpt'; Crpe1.ReportOptions.ConvertDateTimeType := dtConvertToString; Crpe1.Output := toWindow;

Crpe1.Execute;

ReportOptions ConvertNullFieldToDefault property

Declaration

property ConvertNullFieldToDefault: TCrBoolean;

Type

TCrBoolean = (cFalse, cTrue, cDefault);

Description

The ConvertNullFieldToDefault property specifies how Null field values will be treated in a Report: as they are (null), or as a default value (empty string for string fields, zero for numeric fields, etc.). If Null fields are not converted to default, extra care must be taken in Formulas and Selection Formulas to test for Null values, otherwise a null value can cause a formula to stop processing as soon as the null is encountered.

VCL Reference

516

Example

This example sets the ConvertNullFieldToDefault property of ReportOptions:

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

Crpe1.ReportOptions.ConvertNullFieldToDefault := cTrue;

Crpe1.Output := toWindow;

Crpe1.Execute;

ReportOptions CreateGroupTree property

Declaration

property CreateGroupTree: TCrBoolean;

Type

TCrBoolean = (cFalse, cTrue, cDefault);

Description

The CreateGroupTree property determines if the GroupTree panel on the Preview Window will be available or not.

This setting should be used in conjunction with the WindowButtonBar.GroupTree property: if CreateGroupTree is cFalse, the WindowButtonBar.GroupTree will have no effect; if CreateGroupTree is cTrue, then WindowButtonBar.GroupTree can be used to control whether the GroupTree will appear or not.

Example

This example sets the CreateGroupTree property of ReportOptions:

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

Crpe1.ReportOptions.CreateGroupTree := cTrue;

Crpe1.WindowButtonBar.GroupTree := True;

Crpe1.Output := toWindow;

Crpe1.Execute;

ReportOptions NoDataForHiddenObjects property

Declaration

property NoDataForHiddenObjects: TCrBoolean;

Type

TCrBoolean = (cFalse, cTrue, cDefault);

VCL Reference

517

Description

The NoDataForHiddenObjects property determines whether data will be saved for parts of the Report that are in hidden sections.

This will mainly be of concern if a Report is being exported to Crystal Reports format, in which case it will have Saved Data. This saved-data Report can be run from an application without having access to the original database, since all the data required to show the Report is saved with it.

When this exported Report is run later, it is possible to provide drill-down capability (WindowButtonBar.AllowDrillDown). If that is done, it will be necessary for the Report to have saved data for the hidden sections, so that the drill down will not cause the Report to attempt to read the database. So, before exporting the Report, make sure NoDataForHiddenObjects is set to cFalse.

On the other hand, if drill-down will not be offered, make sure NoDataForHiddenObjects is set to cTrue, so that the resulting exported RPT's file size will be smaller.

Example

This example sets the NoDataForHiddenObjects property of ReportOptions so that an exported RPT will have Saved Data for all objects in all sections of the Report, even the hidden ones:

Crpe1.ReportName := 'C:\Company.rpt'; Crpe1.ReportOptions.NoDataForHiddenObjects := cFalse;

{This next one is just a formality: all exported RPT have Saved Data} Crpe1.ReportOptions.SaveDataWithReport := cTrue;

{Save Summaries also: optional} Crpe1.ReportOptions.SaveSummariesWithReport := cTrue; Crpe1.Output := toExport;

Crpe1.Export.Destination := toFile; Crpe1.Export.FileType := CrystalReportRPT; Crpe1.Export.FileName := 'C:\SavedData.rpt'; Crpe1.Execute;

ReportOptions PerformGroupingOnServer property

Declaration

property PerformGroupingOnServer: TCrBoolean;

Type

TCrBoolean = (cFalse, cTrue, cDefault);

Description

The PerformGroupingOnServer property specifies whether the grouping of data for a Report will take place on the Server or not. This option only applies to Reports based off an SQL or ODBC datasource.

VCL Reference

518

Example

This example sets the PerformGroupingOnServer property of ReportOptions:

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

Crpe1.ReportOptions.PerformGroupingOnServer := cTrue;

Crpe1.Output := toWindow;

Crpe1.Execute;

ReportOptions PrintEngineErrorMessages property

Declaration

property PrintEngineErrorMessages: TCrBoolean;

Type

TCrBoolean = (cFalse, cTrue, cDefault);

Description

The PrintEngineErrorMessages property determines if the Print Engine will put up it's own error dialogs, on top of the VCL's error handling. The built-in Print Engine error messages are often more descriptive than the standard error messages returned by the Print Engine to an application. It may be desirable to turn this option on when doing development, but it normally should be turned off when the application is finally deployed.

Example

This example sets the PrintEngineErrorMessages property of ReportOptions:

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

Crpe1.ReportOptions.PrintEngineErrorMessages := cTrue;

Crpe1.Output := toWindow;

Crpe1.Execute;

ReportOptions SaveDataWithReport property

Declaration

property SaveDataWithReport: TCrBoolean;

Type

TCrBoolean = (cFalse, cTrue, cDefault);

VCL Reference

519

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