Unit
IB_Export
Declaration
TIB_Export = class(TIB_DataScan)
Description
This component is used to provide a way to dump out data from a dataset
into a delimited text file, a DBF file or a user defined file.
The text file created can be immediatly taken and used with the BDE ASCIDRV
or if headers are included then it is easy to convert it into an Excel
spreadsheet.
Set the Dataset property to any TIB_Dataset component and call the Execute
method to start the export. If you set it to a buffered dataset it will use
the current buffer to extract data from. If you use a TIB_Cursor then it will
clone the cursor into an internal cursor and scan through it to extract the
data. So, be sure to use a TIB_Cursor as the source on large datasets so that
it won't buffer all the records of the dataset in the process.
It is not desirable to do a unidirectional scan of a large dataset and
buffer all of the records that were fetched. Only one record at a time is
needed so by using the internal IB_Cursor memory usage is independant of the
size of the dataset being exported.
It is also possible to perform some alterations to the internal cursor that
is used to perform the export. One example is to exclude columns in the
original dataset from the exported dataset. Additional selection criteria
could be added to reduce the number of records processed, etc.
All of the dssSearch criteria is applied to the IB_Export as well so it is
very simple to design interfaces to export selected records. Simply give your
users the ability to define search criteria and you have an adhoc exporting
tool without writing any complicated lines of code.
| Introduced Public Properties |
|
Dataset |
Source dataset for the export. |
|
DateTimeFormat |
Format used for date time values in the ASCII export. |
|
Delimiter |
Delimiter character to be used in the ASCII output file. |
|
ExportFormat |
This determins which format will be used for the output. |
|
Filename |
Filename of the output file for ASCII and DBF. |
|
IncludeHeaders |
If true then the names of the columns will be included in the first
row in the ASCII data output file. |
|
Separator |
Separator character to be used in the ASCII output file. |
| Introduced Public Methods |
|
OnTranslateString |
Event that give you an opportunity to translate the string being exported
when exporting out to DBF. |