Home | Sign in | English EN

  • Exporting the query content
  • Exporting a single record
  • Array items
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Stored procedures
Exports the records found in a data file (HFSQL or OLE DB), view or query to a JSON file.
Remark: From version 19, HFSQL is the new name of HyperFileSQL.
// Export all customers
Customer.ExportJSON("C:\TEMP\Customer.json", hExpCreation)
<Result> = <Source>.ExportJSON([<JSON file> [, <Items to export>]] [, <Options> [, <Progress Bar>]])
<Result>: Boolean
  • True if the operation was performed,
  • False if a problem occurred. HError is used to identify the error.
<Source>: Type corresponding to the specified source
Name of data file, view or query used.
<JSON file>: Optional character string
Full path of JSON file to generate.
<Items to export>: Optional character string
List of names of items to export. The names are delimited by single quotes and they are 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 of the data file (except for the composite keys, binary keys and binary memo keys) are exported.
<Options>: Optional constant
Specifies the creation mode of JSON file:
hExpCreationIf the JSON file already exists, it is overwritten. An error occurs if this option is not specified and if the JSON file exists.
hExpBreakableThe export can be interrupted by pressing Esc.
If the export is interrupted, the JSON file is valid and it only contains the records exported before the interruption.
(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 file creation.

Exporting the query content

To export the query content, you must initialize the query (0) before using <Source>.ExportJSON.

Exporting a single record

To export a single record to a JSON string, use <Source>.RecordToJSON.

Array items

If one of the exported items is an array item, each element of the array item is exported in a new level:
"Item1":Data of item 1,
"Item2":Data of item 2,
[Data element 1, Data element 2, ...]

Reminder: Composite key, binary memo or binary items are ignored.
Business / UI classification: Business Logic
Component: wd260hf.dll
Minimum version required
  • Version 25
This page is also available for…
Click [Add] to post a comment