ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / Managing databases / HFSQL / HFSQL functions
  • Exporting the query content
  • Exporting a single record
  • Array items
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
HExportJSONString (Function)
In french: HExporteChaîneJSON
ODBCNative Connectors (Native Accesses)Not available with these kinds of connection
Exports the records from a data file (HFSQL or OLE DB), view or query to a JSON string.
New in version 2025
Android This function is now available for Android applications.
Android Widget This function is now available in Android widget mode.
Example
// Export all customers 
sString is string
sString = HExportJSONString(CUSTOMER)
Syntax
<Result> = HExportJSONString(<Data file> [, <Items to export>] [, <Options> [, <Progress Bar>]])
<Result>: Character string
JSON string.
<Data file>: Character string
Name of data file, view or query used.
<Items to export>: Optional character string
Names of items to be exported. Names are delimited by single quotes and separated by commas or carriage returns (CR characters). The names of composite key items, binary items and binary memo items are ignored.
If this parameter is an empty string (""), all of the data file items are exported (except composite key, binary, binary memo, and password items).
<Options>: Optional Integer constant
Indicates how the JSON file is created:
hExpBreakableThe export can be interrupted by pressing Esc.
If the export is interrupted, the JSON string is valid and contains only the records exported before the interruption.
hExpNormal
(default value)
Standard operating mode.
<Progress Bar>: Optional control name or window name
Name of the Progress Bar control or window that displays the progress of the JSON string creation.
Remarks

Exporting the query content

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

Exporting a single record

To export a single record to a JSON string, use HRecordToJSON.

Array items

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

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

Last update: 06/06/2025

Send a report | Local help