Global variables

Use global variables and functions to change the language, appearance and properties of some OExport features.

List of global variables

NameTypeDescription
OExportLastExportFilterInteger Last used exporter in the save dialog. You may write/read this variable from registry to ensure your users get offered always their last used format.
OExportUseCompressedCacheBoolean Set to true (default) if you want OExport to use compressed cache. This reduces memory consumption but it can slightly reduce export performance.
Compressed cache is used only for XLSX and ODS files and during export.
OExportDateFormat
OExportTimeFormat
OWideString

Use these global formats for new created date/time cells. Please note that these formats are first read by the TExportWorkSheet.NewCellDateFormat and .NewCellTimeFormat that are then used for date/time cells.

You have to set these 2 variables explicitely in every project that uses OExport to ensure your application generates files with date/time format you really want to use. It's a good idea to define them in the initialization section or in your .dpr project file.

You may use the OEXPORT_SYS_DATE and OEXPORT_SYS_TIME constants to use system-dependent date/time formats.

Use time formats with seconds for OExportTimeFormat - the time format without seconds will be automatically created according to it.

Code snippets

Use system-dependent date/time formats:

initialization
  OExportDateFormat := OEXPORT_SYS_DATE;
  OExportTimeFormat := OEXPORT_SYS_TIME;
end.

Use system-independent date/time formats (USA):

initialization
  OExportDateFormat := 'mm-dd-yy';
  OExportTimeFormat := 'h:mm:ss am/pm';
end.

Use system-independent date/time formats (Germany):

initialization
  OExportDateFormat := 'dd.mm.yyyy';
  OExportTimeFormat := 'hh:mm:ss';
end.
Categories