|
@@ -8,6 +8,7 @@ uses
|
|
Classes, SysUtils, DB;
|
|
Classes, SysUtils, DB;
|
|
|
|
|
|
Type
|
|
Type
|
|
|
|
+ TCustomDatasetExporter = Class;
|
|
|
|
|
|
// Quote string fields if value contains a space or delimiter char.
|
|
// Quote string fields if value contains a space or delimiter char.
|
|
TQuoteString = (qsAlways,qsSpace,qsDelimiter);
|
|
TQuoteString = (qsAlways,qsSpace,qsDelimiter);
|
|
@@ -24,6 +25,7 @@ Type
|
|
FFieldName: String;
|
|
FFieldName: String;
|
|
FExportedName: String;
|
|
FExportedName: String;
|
|
function GetExportedName: String;
|
|
function GetExportedName: String;
|
|
|
|
+ function GetExporter: TCustomDatasetExporter;
|
|
procedure SetExportedName(const AValue: String);
|
|
procedure SetExportedName(const AValue: String);
|
|
Protected
|
|
Protected
|
|
Procedure BindField (ADataset : TDataset); virtual;
|
|
Procedure BindField (ADataset : TDataset); virtual;
|
|
@@ -32,6 +34,7 @@ Type
|
|
Constructor Create(ACollection : TCollection); override;
|
|
Constructor Create(ACollection : TCollection); override;
|
|
Procedure Assign(Source : TPersistent); override;
|
|
Procedure Assign(Source : TPersistent); override;
|
|
Property Field : TField Read FField;
|
|
Property Field : TField Read FField;
|
|
|
|
+ Property Exporter : TCustomDatasetExporter Read GetExporter;
|
|
Published
|
|
Published
|
|
Property Enabled : Boolean Read FEnabled Write FEnabled default True;
|
|
Property Enabled : Boolean Read FEnabled Write FEnabled default True;
|
|
Property FieldName : String Read FFieldName Write SetFieldName;
|
|
Property FieldName : String Read FFieldName Write SetFieldName;
|
|
@@ -42,6 +45,7 @@ Type
|
|
|
|
|
|
TExportFields = Class(TCollection)
|
|
TExportFields = Class(TCollection)
|
|
private
|
|
private
|
|
|
|
+ FExporter : TCustomDatasetExporter;
|
|
function GetFieldItem(Index : Integer): TExportFieldItem;
|
|
function GetFieldItem(Index : Integer): TExportFieldItem;
|
|
procedure SetFieldItem(Index : Integer; const AValue: TExportFieldItem);
|
|
procedure SetFieldItem(Index : Integer; const AValue: TExportFieldItem);
|
|
Public
|
|
Public
|
|
@@ -51,9 +55,9 @@ Type
|
|
Function FindExportName(Const AFieldName : String) : TExportFieldItem;
|
|
Function FindExportName(Const AFieldName : String) : TExportFieldItem;
|
|
Function AddField(Const AFieldName : String) : TExportFieldItem; virtual;
|
|
Function AddField(Const AFieldName : String) : TExportFieldItem; virtual;
|
|
Property Fields[Index : Integer] : TExportFieldItem Read GetFieldItem Write SetFieldItem; Default;
|
|
Property Fields[Index : Integer] : TExportFieldItem Read GetFieldItem Write SetFieldItem; Default;
|
|
|
|
+ Property Exporter : TCustomDatasetExporter Read FExporter;
|
|
end;
|
|
end;
|
|
|
|
|
|
- { TExportFormatSettings }
|
|
|
|
|
|
|
|
{ TCustomExportFormatSettings }
|
|
{ TCustomExportFormatSettings }
|
|
|
|
|
|
@@ -85,6 +89,7 @@ Type
|
|
end;
|
|
end;
|
|
TCustomExportFormatSettingsClass = Class of TCustomExportFormatSettings;
|
|
TCustomExportFormatSettingsClass = Class of TCustomExportFormatSettings;
|
|
|
|
|
|
|
|
+ { TExportFormatSettings }
|
|
TExportFormatSettings = Class(TCustomExportFormatSettings)
|
|
TExportFormatSettings = Class(TCustomExportFormatSettings)
|
|
Published
|
|
Published
|
|
Property IntegerFormat;
|
|
Property IntegerFormat;
|
|
@@ -331,6 +336,12 @@ begin
|
|
Result:=FFieldName;
|
|
Result:=FFieldName;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+function TExportFieldItem.GetExporter: TCustomDatasetExporter;
|
|
|
|
+begin
|
|
|
|
+ If Collection is TExportFields then
|
|
|
|
+ Result:=(Collection as TExportFields).Exporter;
|
|
|
|
+end;
|
|
|
|
+
|
|
procedure TExportFieldItem.SetExportedName(const AValue: String);
|
|
procedure TExportFieldItem.SetExportedName(const AValue: String);
|
|
|
|
|
|
Var
|
|
Var
|
|
@@ -641,6 +652,7 @@ begin
|
|
inherited Create(AOwner);
|
|
inherited Create(AOwner);
|
|
FromCurrent:=True;
|
|
FromCurrent:=True;
|
|
FExportFields:=CreateExportFields;
|
|
FExportFields:=CreateExportFields;
|
|
|
|
+ FExportFields.FExporter:=Self;
|
|
FFormatSettings:=CreateFormatSettings;
|
|
FFormatSettings:=CreateFormatSettings;
|
|
end;
|
|
end;
|
|
|
|
|