PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | French EN
New WINDEV, WEBDEV and WINDEV Mobile 25 feature!
  • Exporting the query content
  • Array items
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Exports the records found in a data file (HFSQL or OLE DB), a view or a query to a CSV file.
Reminder: A CSV file (Comma-separated values) is a text file where each line represents a record. The items are separated by commas.
Example
// Export all customers from the Customer data file
Customer.ExportCSV("C:\TEMP\Customer.csv", hExpCreation)
Syntax
<Result> = <Source>.ExportCSV([<CSV file> [, <Items to export> [, <Separator>]]] [, <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.
<CSV file>: Character string (with quotes)
Full path of CSV file to generate.
If this parameter is not specified, a <Data file>.CSV file will be generated in the current directory.
<Items to export>: Optional character string (with quotes)
List of names of items to export. The 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.
<Separator>: Character string (with quotes)
Separator used for the items. This separator corresponds to the comma (",") by default.
<Options>: Optional Integer constant
Specifies the creation mode of CSV file:
hExpCreationIf the CSV file already exists, it is overwritten. An error occurs if this option is not specified and if the CSV file exists.
hExpBreakableThe export can be interrupted by pressing Esc.
If the export is interrupted, the CSV file is valid and contains only the records exported before the interruption.
hExpNormal
(default value)
Standard operating mode.
hExpNoLineItemNameThe first line of the CSV file will not contain the names of the items.
<Progress Bar>: Optional control name or window name
Name of Progress Bar control or name of window used to show the progress of CSV file creation.
Remarks

Exporting the query content

To export the query content, you must initialize the query (<Fichier HFSQL>.ExécuteRequête) before using <Source>.ExportCSV.

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 : wd250hf.dll
Minimum version required
  • Version 25
This page is also available for…
Comments
Click [Add] to post a comment