PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Number of rows: taking the empty rows into account
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
Returns the number of rows found in an XLS file. The result depends on the opening mode of XLS file:
  • In multi-sheet mode, the number of rows is calculated for the worksheet selected by xlsCurrentWorksheet.
  • In compatible mode, the number of rows is always calculated for the first worksheet of workbook.
Note: The number of rows found in an XLS file is returned if:
  • The XLS file exists.
  • The XLS file is opened.
Versions 16 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 16
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.
// Open an XLS file
XLSFileID = xlsOpen("C:\MyDirectory\File.XLS")
IF XLSFileID <> -1 THEN
// Number of rows
ResNbRows = xlsNbRow(XLSFileID)
...
END
Syntax

Syntax that is using the xlsDocument type Hide the details

<Result> = xlsNbRow(<XLS Document> [, <Empty Rows>])
<Result>: Integer
  • Number of rows found in the specified XLS file,
  • -1 if an error occurred (file not opened for example). To find out the error details, use xlsMsgError or ErrorInfo associated with the errMessage constant.
<XLS Document>: xlsDocument variable
Name of xlsDocument variable corresponding to the XLS file to use.
<Empty Rows>: Optional boolean
Defines how the empty rows will be taken into account:
True
(by default)
The rows that are entirely empty are ignored
FalseThe rows that are entirely empty are taken into account

Syntax kept for backward compatibility with version 12 Hide the details

<Result> = xlsNbRow(<Identifier of XLS File> [, <Empty Rows>])
<Result>: Integer
  • Number of rows found in the specified XLS file,
  • -1 if an error occurred (file not opened for example). To find out the error details, use xlsMsgError or ErrorInfo associated with the errMessage constant.
<Identifier of XLS File>: Integer
Identifier of XLS file to handle, returned by xlsOpen.
<Empty Rows>: Optional boolean
Defines how the empty rows will be taken into account:
True
(by default)
The rows that are entirely empty are ignored
FalseThe rows that are entirely empty are taken into account
Remarks

Number of rows: taking the empty rows into account

The empty rows can be taken into account or not. For example:
xlsNbRow(XLSFileID, True) // Returns "6"
xlsNbRow(XLSFileID, False) // Returns "7"
Components
WINDEVWEBDEV - Server codeReports and Queries wd230xls.dll
Linux wd230xls.so
Minimum required version
  • Version 9
This page is also available for…
Comments
Exemplo Ler Excel e Gravar Arquivo
n_abre_excel is int=xlsOpen("nome_excel.xls")
n_numero_linhas is int=xlsNbRow(n_abre_excel)
n_contador is int=0
FOR n_contador = 2 TO n_numero_linhas
HReset(nota_rps_servico)
s_codigo_municipio is string=xlsData(n_abre_excel,n_contador,3)
nota_rps_servico.codigo_municipio=s_codigo_municipio
HAdd(nota_rps_servico)
END
Info("Final da Gravacao")
//-----------------------------------------------------------
//Blog com Video e Exemplo
http://windevdesenvolvimento.blogspot.com.br/2016/01/curso-windev-excel-001-ler-planilha.html
De matos AMARILDO
Feb. 02 2016