PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK

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
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 WINDEV applications in Linux.
Linux This function is now available for WEBDEV sites in Linux.
New in version 23
WINDEVLinux This function is now available for WINDEV applications in Linux.
Linux This function is now available for WEBDEV sites in Linux.
WINDEVLinux This function is now available for WINDEV applications in Linux.
Linux This function is now available for WEBDEV sites in Linux.
Example
// Import "C:\MyFiles\Customer.xls" into the Customer data file.
// The Customer data file will be overwritten if it already exists (hImpCreation constant)
// A progress bar will be displayed in PROGBAR_ProgBar1
HImportXLS(Customer, "C:\MyFiles\Customer.xls", 1, "", hImpCreation, PROGBAR_ProgBar1)
Syntax
<Result> = HImportXLS(<Data file> , <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.
<Data file>: Character string (with or without quotes)
Name of the HFSQL data file into which the import must be performed.
Remark: If the HFSQL data file used does not physically exist, it will be 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 in the XLS or XLSX file will be imported.
<List of destination items>: Optional character string (with quotes)
List of names of data file 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 row of the imported XLS file is ignored.
hImpIgnoreEmptyItemIf one or more items are not filled in the XLS file, the corresponding rows 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 on the keyboard.
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 Connectors (Native Accesses) The management of integrity and duplicates is always enabled.
hImpTestDuplicatesEnables the management of duplicates on unique keys during the import (the management of duplicates is enabled on unique keys only and not on the entire record).
OLE DBNative Connectors (Native Accesses) The management of duplicates is always enabled.
hImpTestIntegrityChecks the integrity during the import.
OLE DBNative Connectors (Native 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 control name or window name
  • Name of window where the progress bar will be displayed,
  • Name of Progress Bar control used to display the progress.
Component : wd250hf.dll
Minimum version required
  • Version 20
This page is also available for…
Comments
Click [Add] to post a comment