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

Export Excel5Ext ColumnWidth property

Declaration

property ColumnWidth: TCrColumnWidth;

Type

TCrColumnWidth = (ByArea, ByConstant);

Description

ColumnWidth determines how the column width is calculated on a Report exported to Excel5Extended. If it is set to ByArea, then the column width is determined by the Area property setting. If it is set to ByConstant, then the column width is determined by the Constant property setting. Area allows Crystal to set the width based on the objects in a certain Report area; Constant allows the programmer to hard-code a column width value.

Example

Exporting to File in Excel5Extended format. The Column Width is determined by the Details area of the Report:

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

Crpe1.Output := toExport;

Crpe1.Export.Destination := toFile;

Crpe1.Export.FileType := Excel5Extended;

Crpe1.Export.Excel5Ext.ColumnHeadings := True;

Crpe1.Export.Excel5Ext.ColumnWidth := ByArea;

Crpe1.Export.Excel5Ext.Area := 'D';

Crpe1.Export.Excel5Ext.TabularFormat := True;

Crpe1.Execute;

Exporting to File in Excel5Extended format. The Column Width is determined by the value of the Constant property, in this case, 12:

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

Crpe1.Output := toExport;

Crpe1.Export.Destination := toFile;

Crpe1.Export.FileType := Excel5Extended;

Crpe1.Export.Excel5Ext.ColumnHeadings := True;

Crpe1.Export.Excel5Ext.ColumnWidth := ByConstant;

Crpe1.Export.Excel5Ext.Constant := 12;

Crpe1.Export.Excel5Ext.TabularFormat := True;

Crpe1.Execute;

VCL Reference

268

Export Excel5Ext Constant property

Declaration

property Constant: double;

Description

If the ColumnWidth property is set to ByConstant, the Constant property determines the column width on a Report exported to Excel5Extended. The default setting for the Constant property is 9.

Example

Exporting to File in Excel5Extended format. The Column Width is determined by the value of the Constant property, in this case, 12:

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

Crpe1.Output := toExport;

Crpe1.Export.Destination := toFile;

Crpe1.Export.FileType := Excel5Extended;

Crpe1.Export.Excel5Ext.ColumnHeadings := True;

Crpe1.Export.Excel5Ext.ColumnWidth := ByConstant;

Crpe1.Export.Excel5Ext.Constant := 12;

Crpe1.Export.Excel5Ext.TabularFormat := True;

Crpe1.Execute;

Export Excel5Ext TabularFormat property

Declaration

property TabularFormat: boolean;

Description

The TabularFormat property determines if all the objects in one area in a Report will be arranged into one row (when TabularFormat is True), or whether they will be split into separate rows (when TabularFormat is False).

VCL Reference

269

Example

Exporting to File in Excel5Extended format with tabular format active:

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

Crpe1.Output := toExport;

Crpe1.Export.Destination := toFile;

Crpe1.Export.FileType := Excel5Extended;

Crpe1.Export.Excel5Ext.ColumnHeadings := True;

Crpe1.Export.Excel5Ext.ColumnWidth := ByArea;

Crpe1.Export.Excel5Ext.Area := 'D';

Crpe1.Export.Excel5Ext.TabularFormat := True;

Crpe1.Execute;

Export Excel5Ext Clear method

Declaration

procedure Clear;

Description

This method can be used to set the properties of the Excel5Ext object back to their default values:

Area

:= 'D';

ColumnHeadings

:= False;

ColumnWidth

:= ByArea;

Constant

:= 9;

TabularFormat

:= False;

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

Example

This code sets the Excel5Ext properties back to default:

Crpe1.Export.Excel5Ext.Clear;

Export Excel5Ext CopyFrom method

Declaration

function CopyFrom(Source: TCrpeExportExcel5Ext): boolean;

VCL Reference

270

Description

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

var

tempExcel5Ext : TCrpeExportExcel5Ext; begin

tempExcel5Ext := TCrpeExportExcel5Ext.Create; tempExcel5Ext.CopyFrom(Crpe1.Export.Excel5Ext); {...later, when finished with the temp object...} tempExcel5Ext.Free;

end;

Export Excel5Ext Create method

Declaration

constructor Create;

Description

The Create method is used internally in the Crystal component to create the Excel5Ext object, and does not need to be called in code, unless you are using the CopyFrom method to store Excel5Ext data to a temporary object:

var

tempExcel5Ext : TCrpeExcel5Ext; begin

tempExcel5Ext := TCrpeExcel5Ext.Create; tempExcel5Ext.CopyFrom(Crpe1.Export.Excel5Ext);

end;

Export Exchange Property

Declaration

property Exchange: TCrpeExportExchange;

Type

TCrpeExportExchange = class(TPersistent)

VCL Reference

271

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