PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

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
HImportXLS (Function)
In French: HImporteXLS
HFSQLHFSQL Client/ServerAvailable only with these kinds of connection
Imports an XLS or XLSX file into a data file in HFSQL Classic or Client/Server format (data file described in the data model editor, or declared by HDeclare, HDeclareExternal or HDescribeFile).
Versions 23 and later
WINDEVLinux This function is now available for the WINDEV applications in Linux.
WEBDEV - Server codeLinux This function is now available for the WEBDEV sites in Linux.
New in version 23
WINDEVLinux This function is now available for the WINDEV applications in Linux.
WEBDEV - Server codeLinux This function is now available for the WEBDEV sites in Linux.
WINDEVLinux This function is now available for the WINDEV applications in Linux.
WEBDEV - Server codeLinux This function is now available for the WEBDEV sites in Linux.
Example
// Import the "C:\MyFiles\Customer.xls" file into the Customer file.
// The Customer file will be overwritten if it already exists (hImpCreation constant)
// A progress bar will be displayed in the PROGBAR_ProgBar1 control
HImportXLS(Customer, "C:\MyFiles\Customer.xls", 1, hImpCreation, PROGBAR_ProgBar1)
Syntax
<Result> = HImportXLS(<File Name> , <Path of XLS or XLSX File> [, <Worksheet Number> [, <List of Destination Items> [, <Options> [, <Progress Bar>]]]])
<Result>: Boolean
  • True if the operation was performed,
  • False if an error occurred.
    HError is used to identify the problem.
<File Name>: Character string (with or without quotes)
Logical name of data file in HFSQL format into which the import will be performed.
Note: If the HFSQL data file used does not physically exist, this data file is automatically created.
<Path of XLS or XLSX File>: Character string with quotes
Full access path to XLS or XLSX file to import.
Linux Only the XLSX files can be used.
<Worksheet Number>: Optional integer
Worksheet number in the XLS or XLSX file to import.
If this parameter is not specified, the first worksheet found in the XLS or XLSX file is imported.
<List of Destination Items>: Optional character string (with quotes)
List of names of items into which the import will be performed. The names can be delimited by single quotes and they are separated by commas or CR characters.
The names of the composite key items, binary memo items and binary items are ignored.
The non-imported items will be initialized with their default value described in the analysis.
If this parameter is not specified or if it corresponds to an empty string, all the items are imported (except the composite keys, the binary items and the binary memos) in the physical order of description.
<Options>: Optional Integer constant (or combination of constants)
Configures the type of import to perform:
hCopyAutoIdThe automatic identifier is copied. It is not recalculated.
hImpCreationIf the import data file exists, it is overwritten.
hImpIgnoreFirstLineThe first line of the imported file is ignored.
hImpIgnoreEmptyItemIf one or more items are not filled in the XLS file, the corresponding lines are still imported.
The missing items contain:
  • the default value of items if the hDefaultVal constant is specified.
  • the value of items in the current record before the call to HImportXLS.
hImpBreakableThe import can be interrupted by pressing the ESC key.
If the import is interrupted, the imported records are kept in the data file.
hImpNormal
(default value)
If the import data file already exists, it is filled with the imported data ; otherwise, the data file is created.
No management of integrity and no management of duplicates.
The non-imported items take the value of the current record.
The automatic identifiers are recalculated.
OLE DBNative Accesses The management of integrity and duplicates is always enabled.
hImpTestDuplicatesEnables the management of duplicates on the unique keys during the import (the management of duplicates is enabled on the unique keys only and not on the entire record).
OLE DBNative Accesses The management of duplicates is always enabled.
hImpTestIntegrityChecks the integrity during the import.
OLE DBNative Accesses The management of integrity is always enabled.
hDefaultValFor the non-imported items, the values of the current record are reinitialized:
  • with their default value if the hDefaultVal constant is specified.
  • with the value of the corresponding items in the current record before the call to HImportXLS if the hDefaultVal constant is not specified.
<Progress Bar>: Optional character string (with or without quotes)
  • Name of window where the progress bar will be displayed,
  • Name of Progress Bar control used to display the progress.
WEBDEV - Server code This parameter is not available.
Components
WINDEVWEBDEV - Server code wd230hf.dll
Linux wd230hf.so
Minimum required version
  • Version 20
This page is also available for…
Comments
Click [Add] to post a comment