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

Export ODBC Password property

Declaration

property Password: string;

Description

Specifies the Password required to connect to an ODBC Data Source when exporting a Report in ODBC format. This is only required if the ODBC Data Source that you are exporting to requires a Password (most SQL types do, most PC types don't).

Example

Exporting to File in ODBC-Table format:

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

with Crpe1.Export do begin

Destination := toFile; FileType := ODBCTable; ODBC.Source := 'SQLServer'; ODBC.User := 'Maxwell Smart'; ODBC.Password := 'Agent86'; ODBC.Table := 'ReportTable';

end; Crpe1.Execute;

Export ODBC Source property

Declaration

property Source: string;

Description

Specifies the name of the ODBC Data Source to export to when exporting a Report in ODBC format.

VCL Reference

281

Example

Exporting to File in ODBC-Table format: Crpe1.ReportName := 'C:\Company.rpt'; Crpe1.Output := toExport;

with Crpe1.Export do begin

Destination := toFile; FileType := ODBCTable; ODBC.Source := 'SQLServer'; ODBC.User := 'Maxwell Smart'; ODBC.Password := 'Agent86'; ODBC.Table := 'ReportTable';

end; Crpe1.Execute;

Export ODBC Table property

Declaration

property Table: string;

Description

Specifies the name of the Table to export to when exporting a Report in ODBC format.

Example

Exporting to File in ODBC-Table format:

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

with Crpe1.Export do begin

Destination := toFile; FileType := ODBCTable; ODBC.Source := 'SQLServer'; ODBC.User := 'Maxwell Smart'; ODBC.Password := 'Agent86'; ODBC.Table := 'ReportTable';

end; Crpe1.Execute;

VCL Reference

282

Export ODBC User property

Declaration

property User: string;

Description

Specifies the UserID required to connect to the ODBC Data Source when exporting a Report in ODBC format.

Example

Exporting to File in ODBC-Table format:

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

with Crpe1.Export do begin

Destination := toFile; FileType := ODBCTable; ODBC.Source := 'SQLServer'; ODBC.User := 'Maxwell Smart'; ODBC.Password := 'Agent86'; ODBC.Table := 'ReportTable';

end; Crpe1.Execute;

Export ODBC Clear method

Declaration

procedure Clear;

Description

This method can be used to set the ODBC properties to their default values:

Source := '';

User := '';

Password := '';

Table := '';

It is called automatically if the Clear method is called for the main component, but may be called in code as needed.

VCL Reference

283

Example

This line of code clears the ODBC Export properties:

Crpe1.Export.ODBC.Clear;

Export ODBC CopyFrom method

Declaration

function CopyFrom(Source: TCrpeExportODBC): boolean;

Description

The CopyFrom method copies the ODBC property values from another TCrpeExportODBC 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 ODBC property values to a temporary TCrpeExportODBC object:

var

tempODBC : TCrpeExportODBC; begin

tempODBC := TCrpeExportODBC.Create; tempODBC.CopyFrom(Crpe1.Export.ODBC);

{...later, when finished with the temp object...} tempODBC.Free;

end;

Export PromptForOptions property

Declaration

property PromptForOptions: boolean

VCL Reference

284

Description

PromptForOptions determines if the Crystal Reports Print Engine will use the Export Options specified in the VCL properties, or if it will prompt the user for those values. The prompt dialog boxes are the same as those seen when the Export button is pressed in the Crystal Reports runtime Preview Window, of which the following are samples:

NOTE: The VCL Export property settings will not affect the default state of the properties in the Print Engine prompt dialogs.

Example

The following code will export a Report and prompt the user for the values:

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

Crpe1.Output := toExport;

Crpe1.Export.Destination := toFile;

Crpe1.Export.PromptForOptions := True;

Crpe1.Execute;

VCL Reference

285

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