Components for uploading DataSet to a text file and load a text file
Components for uploading DataSet to a text file and load a text file
The library contains components for uploading data from a DataSet to a text file for later downloading from it.
Data can be uploaded to a file in a format with separators of values or in a format of the fixed length for each field.
When importing and exporting data it is possible to set additional settings of the data format such as: Format of dates, date separator, time format, time separator, decimal separator, etc.
Component TDataSetTextExporterEh
In Design-Time call the following method to configure component’s properties which will define format of uploaded in Run-Time data
procedure TDataSetTextExporterEh.ExportToFile(AFileName: String;
AppendToFile: Boolean = False);
or
procedure TDataSetTextExporterEh.ExportToStream(AStream: TStream);The first method stores data in a file, the second one stores data in a stream. If set AppendToFile to True, then data will be append to the file but not will be rewritten.
Main properties of TDataSetTextExporterEh component
DataSet: TDataSet
Encoding: TExportImportEncodingEh
TExportImportEncodingEh type has the following values:
eieAutoEh - upload data in format specified by the global variable DefaultExportEncoding.
eieUTF7Eh - upload data in format eieUTF7Eh.
Other values: eieUTF8Eh, eieUnicodeEh, eieBigEndianUnicodeEh, eieANSIEh, eieASCIIEh.
ValueSeparationStyle: TValueSeparationStyleEh
Style of division of values during exporting data
vssFixedPositionAndSizeEh – fields have fixed lengths specified through TFieldsMapItemEh.FileFieldLen
vssDelimiterSeparatedEh – fields are separated by a separator specified by ValueDelimiter property.
ValueDelimiter: Char
QuoteChar: Char
IsExportFieldNames: Boolean
ExportValueAsDisplayText: Boolean
ValueExceedsSizeLimitAction: TValueExceedsSizeLimitActionEh
ExportRecordsCount: Integer
ExportFormats: TExportImportFormatsEh
FieldsMap: TFieldsMapCollectionEh
Main events of TDataSetTextExporterEh component
OnStartExport: TNotifyEvent
OnFinishExport: TNotifyEvent
OnExportTitle: TDataSetTextExporterExportLineEventEh
OnExportRecord: TDataSetTextExporterExportLineEventEh
OnTruncateTitleField: TTruncateTitleFieldEventEh
OnTruncateDataField: TTruncateDataFieldEventEh
OnGetFieldSize: TGetFieldSizeEventEh
OnFormatExportValue: TFormatTextExportValueEventEh
Component TDataSetTextImporterEh
Configure component’s properties in Design-Time.
Call the following method in Run-Time
procedure TDataSetTextImporterEh.ImportFromFile(AFileName: String);
or
procedure TDataSetTextImporterEh.ImportFromStream(AStream: TStream);See demo project in folder <EhLib Archive>/DEMOS/DataSetImpExp
