ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Controls, pages and windows / Looper functions
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Creates an Excel file with data from a RepeatString field (RepeatString field file or RepeatString field memory).
Remark: This file can be opened in Excel or OpenOffice Calc (depending on the software installed on the current workstation).
Example
Reports and Queries
sFic is string
// Nom du fichier
sFic = fSelect("", "", "Choisissez le fichier d'exportation", ...
	"Fichiers Excel (*.xls) *.xls", "xls", fselCreate + fselExist)
// Si le nom n'a pas été fourni, on abandonne l'export
// Sinon, on exporte le contenu du champ Zone répétée ZR_Client
IF sFic <> "" THEN 
	ZR_Client.VersExcel(sFic)
END
Syntax
<Result> = <Looper control>.ToExcel(<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.
taColumnsTitles
(default value)
The name of attributes is used in the Excel file as title of columns.
taMergeIf the XLS file already exists, merge the existing content with the new content: the formulas, formatting, etc. of the existing cells are retained.. 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.
Remarks
  • 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. Please note: in this case, older versions of Excel will need to be equipped with the "Office 2007 Compatibility Pack", which can be downloaded free of charge from the Microsoft website, in order to be able 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: wd300xls.dll
Minimum version required
  • Version 23
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 09/21/2024

Send a report | Local help