Help / WLanguage / Managing databases / HFSQL / HFSQL functions
  • Exporting the query content
  • Array items
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Stored procedures
Exports records from a data file (HFSQL or OLE DB), view or query to an Excel file (XLSX).
// Export all customers from the Customer data file
HExportXLS(Customer, "C:\TEMP\Customer.xlsx", hExpCréation)
<Result> = HExportXLS(<Data file> , <Excel file path> , <List of items to export> [, <Options> [, <Progress Bar>]])
<Result>: Boolean
  • True if the operation was performed,
  • False if a problem occurs. HError is used to identify the error.
<Data file>: Character string
Name of the data file, view or query used. If this name is not specified, HExportXLS will use the last data file used by the last HFSQL function (function starting with "H").
<Excel file path>: Character string
Full path of Excel (XLSX) file to be generated.
If this parameter is not specified, a <File name>.XLSX file will be generated in the current directory.
<List of items to export>: Character string
List of names of items to export. Names are delimited by single quotes and separated by commas or CR characters. The names of composite key items, binary items and binary memo items are ignored.
If this parameter corresponds to an empty string (""), all the items in the data file (except composite key, binary and binary memo items) are exported.
Remark: Data exported from Text Memo items can be truncated by Excel depending on the memo size.
<Options>: Optional Integer constant
Specifies the creation mode of the Excel file:
hExpBreakableThe export can be interrupted by pressing Esc.
If the export is interrupted, the XLSX file is valid and contains only the records exported before the interruption.
hExpCreationIf the XLSX export file already exists, it is overwritten. An error occurs if this option is not specified and if the XLSX file exists.
hExpNoLineItemNameThe first line of the XLSX file will not contain the names of the items.
(default value)
Standard operating mode.
<Progress Bar>: Optional control name or window name
Name of Progress Bar control or name of window used to show the progress of Excel file creation.

Exporting the query content

To export the query content, you must initialize the query (HExecuteQuery) before using HExportXLS.

Array items

If one of the exported items is an array item, each element of the array item <ARRAYITEM> is exported in a <ARRAYITEM>_<Item subscript> item.
Reminder: Composite key, binary memo or binary items are ignored.
Component: wd290hf.dll
Minimum version required
  • Version 24
This page is also available for…
Click [Add] to post a comment

Last update: 03/09/2023

Send a report | Local help