AddCollectionField

Attachments, Document properties

Description

Declares one column of the portfolio's schema.

Syntax

Delphi

Function TPDFlib.AddCollectionField(Const FieldKey, DisplayName: WideString; FieldType, Order, Visible: Integer): Integer;

Parameters

FieldKeyInternal key the column is addressed by, also used with SetCollectionItemValue.
DisplayNameColumn heading shown in the viewer.
FieldType0 text, 1 date, 2 number, 3 file name, 4 description, 5 modification date, 6 creation date, 7 size.
OrderColumn position in the viewer.
Visible1 shows the column, 0 keeps it hidden but addressable.

Return values

0Invalid field type or empty key.
1The field was declared.

Remarks

Types 3 to 7 are filled by the viewer from the file specification itself; types 0 to 2 are custom columns whose values come from SetCollectionItemValue. Re-declaring an existing key replaces it.

Example

PDF.AddCollectionField('Dept', 'Department', 0, 1, 1);
PDF.AddCollectionField('Amount', 'Amount', 2, 2, 1);

See also

SetCollectionView, SetCollectionItemValue, GetCollectionFieldCount