TOExport

Description

TOExport is the main class of the OExport library. Use it for creating and reading XLSX and ODS files.

Properties

NameTypeDescription
DefaultFontNameOWideStringThe default font name of the document.
WorkSheetsTExportWorkSheetsWorksheet list in your document
ActiveWorkSheetTExportWorkSheetActive sheet. This is an OExport-only property. I you want to set the open/active work sheet in the workbook, use OpenWorkSheet.
OpenWorkSheetTExportWorkSheetThe open/active sheet in the workbook file.
NamedCellsTExportNamedCellsThe named cells with workbook validity.
StandardFontTExportFontThe standard font of the workbook.
TitleOWideStringDocument title
WorkbookCodeNameOWideStringCode name of the workbook as it is used in VBA macros.
AuthorOWideStringDocument author
ApplicationOWideStringCreator application
Use1904DateSystemBooleanUse 1904 date system for excel workbook. More information.
AutoAdjustFormulasBooleanWhen True OExport will adjust formulas when you delete or insert rews and cell just the same Excel does. False by default.
SaveOnTheFlyBooleanUse on-the-fly approach when exporting this document. See code snippet.
LoadOnTheFlyBooleanUse on-the-fly approach when importing this document. See code snippet.
LoadOnTheFlyOnAddWorkSheetTExportAddWorkSheetEventThis event is called when a new worksheet is about to be imported during on-the-fly import.
LoadOnTheFlyOnAddRowTExportAddRowEventThis event is called when a new row has been imported during on-the-fly import.
OnTheFlyParamPointerStore a user-defined object here.
UseProgressBooleanIf set to false, no progress events are fired and no progress is shown.

Events

NameTypeDescription
OnProgressTExportProgressNotificationProgress event

Functions & procedures

function AddWorkSheet(const aTitle: OWideString = ''): TExportWorkSheet;
Adds a new worksheet with a title to the document. The title must be unique - if it's empty an automatic title from the language variable oexport_worksheet will be assigned and followed by the worksheet index (e.g. Worksheet 1).

Functions & procedures - saving files

procedure SaveToStream(const aStream: TStream; const aExporter: TOCustomExporter); overload;
procedure SaveToFile(const aFileName: OWideString; const aExecuteFileAfterExport: Boolean = False); overload;
Saves the document to a stream/file with a defined exporter. The document can be opened automatically after the export.
procedure SaveToStream(const aStream: TStream; const aExporterClass: TOExporterClass); overload;

procedure SaveToFile(const aFileName: OWideString; const aExporterClass: TOExporterClass; const aExecuteFileAfterExport: Boolean = False); overload;
Saves the document to a stream/file with a defined exporter class. The exporter will be created automatically. The document can be opened automatically after the export.
procedure SaveToFile(const aFileName: OWideString; const aExecuteFileAfterExport: Boolean = False); overload;
Saves the document to a file. The exporter will picked up from the global exporter list according to the extension of the file name. The document can be opened automatically after the export.
function SaveToFileWithDialog(const aFileName: OWideString = '';
  const aInitialDir: OWideString = ''; const aExecuteFileAfterExport: Boolean = False): Boolean;
Opens a save dialog before exporting the document with a list of file types from the global exporter list.
The exporter will picked up from the global exporter list according to the extension of the file name or the file type user has chosen.
Use aFileName and aInitialDir as default parameters for the dialog.
The document can be opened automatically after the export.

Functions & procedures - loading files

procedure LoadFromStream(const aStream: TStream; const aExporter: TOCustomExporter); overload;
procedure LoadFromFile(const aFileName: OWideString; const aExporter: TOCustomExporter); overload;
Loads a document from a stream/file with a defined exporter.
procedure LoadFromStream(const aStream: TStream; const aExporterClass: TOExporterClass); overload;
procedure LoadFromFile(const aFileName: OWideString; const aExporterClass: TOExporterClass); overload;
Loads a document from a stream/file with a defined exporter class. The exporter will be created automatically.
procedure LoadFromFile(const aFileName: OWideString); overload;
Loads a document from a file. The exporter will picked up from the global exporter list according to the extension of the file name.
function LoadFromFileWithDialog(const aFileName: OWideString = '';
  const aInitialDir: OWideString = ''): Boolean;
Opens an open dialog in which the user chooses the document which he wants to import. The filter list of file types will be taken from the global exporter list.
The exporter will picked up from the global exporter list according to the extension of the file name or the file type user has chosen.
Use aFileName and aInitialDir as default parameters for the dialog.
Categories