Help / WLanguage / WLanguage functions / Controls, pages and windows / Looper functions
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Stored procedures
Creates an Excel file from the data found in a Looper control (browsing Looper control or memory Looper control).
Remark: This file can be opened by Excel or by OpenOffice Calc (depending on the software installed on the current computer).
WINDEVReports and QueriesUser code (UMC)
sFile is string
// File name
sFile = fSelect("", "", "Choose the export file", ...
"Excel files (*.xls) *.xls", "xls", fselCreate + fselExist)
// The export is canceled if no name was specified
// Otherwise, export the content of the LOOP_Customer Looper control
IF sFile <> "" THEN LooperToExcel(LOOP_Customer, sFile)
WEBDEV - Server codeAjax
sFile is string
sFile = CompleteDir(fDataDir()) + "\Export.xls"
IF sFile <> "" THEN LooperToExcel(LOOP_Customer, sFile)
<Result> = LooperToExcel(<Looper control> , <Name of XLS file> [, <Options> [, <Start row> [, <End row>]]])
<Result>: Boolean
  • True if the file was created,
  • False otherwise. To get more details on the error, use ErrorInfo.
<Looper control>: Control name
Name of the Looper control to be used.
<Name of XLS file>: Character string
Name and full path of Excel file to create. The file is replaced with the new file if it already exists.
<Options>: Optional Integer constant
Configures the XLS file to create.
(default value)
The name of attributes is used in the Excel file as title of columns.
taMergeIf the XLS file already exists, merges the existing content with the new content: the formulas, the formatting, ... of existing cells is kept. The existing data is not stored. Only the data of columns and rows found as well in the existing XLS file is kept.
taNoTitleOnly the data is copied to the file. The name of attributes is not specified in column title in the Excel file.
taSelectedLinesExports the selected rows only (all the rows are exported by default).
taWithLayoutExports the color and the font used in the control.
<Start row>: Optional integer
Number of the row from which the export will start.
If this parameter is not specified, the start row will be the first row found in the Looper control.
<End row>: Optional integer
Number of the row where the export will end.
If this parameter is not specified, the end row is the last row found in the Looper control.
  • The Excel files cannot exceed 65536 rows and 256 columns (which means 65536 rows containing 256 controls each). This limit can be exceeded by using the ".xlsx" extension in order to create files in Excel 2007 format. Caution: in this case, the former versions of Excel must be equipped with the "Compatibility Pack Office 2007" that can be freely downloaded from the Microsoft site in order to open the generated documents.
  • Only the first 256 characters of each control are exported.
  • The created file can be opened by Excel 97 (or later) or by OpenOffice Calc 2 (or later).
  • The "High-Precision Numeric" columns (38 significant digits) will be exported as exponential number.
  • Unicode columns are exported in Unicode format to Excel.
  • Check Box columns are exported as Check Boxes.
  • The following elements are not exported into the Excel file:
    • The images,
    • The charts,
    • The bar codes.
Component: wd280xls.dll
Minimum version required
  • Version 10
This page is also available for…
Click [Add] to post a comment

Last update: 06/22/2023

Send a report | Local help