PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Use conditions
  • Limit
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
Creates a character string from the data found in a Table or TreeView Table control. This string can be saved in a specific format thereafter.
Example
sText is string
sText = TableToText(TABLE_TABLE1, taNoTitle, ";")
fSaveText("Export.csv", sText)
Syntax
<Result> = TableToText(<Table control> [, <Options> [, <Column Separator> [, <Row Separator> [, <Start row> [, <End row>]]]]])
<Result>: Character string
  • Character string containing the table data. In this string, the columns are separated by <Separator> and the rows are separated by CR characters (Carriage Return).
  • Empty string ("") if an error occurred or if the table is empty.
<Table control>: Control name
Name of control to use. This control can correspond to:
  • a Table control.
  • a TreeView Table control.
<Options>: Optional constant
Configures the information that must be taken into account in the string.
taWithInvisibleColumnsAlso exports the invisible control columns.
taColumnDisplayedOrderExports the columns according to the order of columns currently displayed in the control (and not according to the order of columns defined in the editor).
taSelectedLinesExports the selected rows only (all the rows are exported by default).
taNoTitleOnly the data is copied.
taNoTotalDoes not export:
  • the rows containing totals, mean and automatic count (these rows are exported by default).
taColumnsTitles
(Default value)
The title of the columns is inserted.
<Column Separator>: Optional character string (with quotes)
Separator used between the columns. The default separator is the tabulation (TAB).
<Row Separator>: Optional character string (with quotes)
Separator used between the rows. The separator used by default is the CR character (Carriage Return).
<Start row>: Optional integer
Number of the row where the export will start.
If this parameter is not specified, the start row is the first row of 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 of control.
Remarks

Use conditions

TableToText can be used on:
  • a browsing or memory control.
  • a single-selection or multiselection control.

Limit

The merged columns are ignored.
Related Examples:
The TableTo functions Unit examples (WINDEV): The TableTo functions
[ + ] Exporting table data with the WLanguage functions.
The following topics are presented in this example:
1/ interfacing with Word and Excel
2/ sending data to the clipboard
3/ generating a text file
This example explains how to export the content of a table to a Word document, an Excel workbook, the clipboard or a text file via the following WLanguage functions: TableToWord, TableToExcel, ToClipboard, TableToText.
Component : wd250std.dll
Minimum version required
  • Version 12
This page is also available for…
Comments
Video TableToText
https://youtu.be/wfcT5NljXnc

https://windevdesenvolvimento.blogspot.com/2019/02/dicas-2014-windev-tabela-90-tabletotext.html

//

sTEXTO is string = TableToText(TABLE_WIN_TABELA_EXEMPLO, taNoTitle, ";")
fSaveText("TEXTO.TXT", sTEXTO)
ShellExecute("TEXTO.TXT")
amarildo
12 Feb. 2019