|
- Use conditions
- Various
- Printing in an XLS file
TableToExcel (Function) In french: TableVersExcel Syntax
Selecting all rows or the first N rows found in the Table or TreeView Table control Hide the details
<Result> = TableToExcel(<Table control> , <XLS file to create> [, <Options> [, <Number of exported rows>]])
<Result>: Boolean - True if the file was created,
- False otherwise. For more details about the error, use the ErrorInfo function.
<Table control>: Control name Name of control to use. This control can correspond to: - a Table control.
- a TreeView Table control.
<XLS file to create>: Character string (with quotes) Name and full path of Excel file to create. The file is replaced by the new file if it already exists. <Options>: Optional Integer constant Configures the XLS file to create. | | taWithInvisibleColumns | Also exports the invisible control columns. Versions 22 and later New in version 22 | taWithLayout | Exports the color and the font used in the control. | taColumnDisplayedOrder | Exports 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).
| taMerge | If 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. | taSelectedLines | Exports the selected rows only (all the rows are exported by default). Does not export the totals. | taNoTitle | Only the data is copied into the file. | taNoTotal | Does not export: - the rows containing totals, mean and automatic count (these rows are exported by default).
Versions 22 and later the rows containing custom calculations (these rows are exported by default). New in version 22 the rows containing custom calculations (these rows are exported by default). the rows containing custom calculations (these rows are exported by default).
| taColumnsTitles (default value) | The title of columns is inserted into the file. |
<Number of exported rows>: Optional integer Number of rows to export. Only the rows found between 1 and <Number of exported rows> will be exported.All rows found in the Table control will be exported if this parameter is not specified.
Selecting the rows found in the Table or TreeView Table control Hide the details
<Result> = TableToExcel(<Table control> , <XLS file to create> [, <Options> [, <Start row> [, <End row>]]])
<Result>: Boolean - True if the file was created,
- False otherwise. For more details about the error, use the ErrorInfo function.
<Table control>: Control name Name of control to use. This control can correspond to: - a Table control.
- a TreeView Table control.
<XLS file to create>: Character string (with quotes) Name and full path of Excel file to create. The file is replaced by the new file if it already exists. <Options>: Optional Integer constant Configuration of XLS file to create. | | taWithInvisibleColumns | Also exports the invisible control columns.
| taWithLayout | Exports the color and the font used in the control. | taColumnDisplayedOrder | Exports 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).
| taMerge | If the XLS file already exists, merges the existing content with the new content: the formulas, the formatting, ... of existing cells is kept. | taSelectedLines | Exports the selected rows only (all the rows are exported by default). Does not export the totals. | taNoTitle | Only the data is copied into the file. | taNoTotal | Does not export: - the rows containing totals, mean and automatic count (these rows are exported by default).
Versions 22 and later the rows containing custom calculations (these rows are exported by default). New in version 22 the rows containing custom calculations (these rows are exported by default). the rows containing custom calculations (these rows are exported by default).
|
<Start row>: Optional integer Number of the row where the export will start. All the control rows will be exported if this parameter and <End row> are not specified. <End row>: Optional integer Number of the row where the export will end. All the control rows will be exported if this parameter and <Start row> are not specified. Remarks Use conditions TableToExcel can be used on: - a browsing or memory control.
- a single-selection or multiselection control.
- The Excel files cannot exceed 65536 rows and 256 columns if the extension used is ".xls". 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 "Office 2007 compatibility pack", that can be downloaded from the Microsoft site in order to open the generated documents.
- The created file can be opened by Excel 97 (or later) or by OpenOffice Calc 2 (or later).
- "High-Precision Numeric" columns (38 significant digits) will be exported as exponential numbers.
- The merge operation performed on the Table control columns is ignored.
- Unicode columns are exported in Unicode format to Excel.
- Check Box columns are exported as Check Boxes.
- RTF columns are exported without formatting.
- The following elements are not exported into the Excel file:
- The images,
- The charts,
- The bar codes.
It is possible to print directly in an XLS file: The created XLS file is configured by iParameterXLS.
Related Examples:
|
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.
|
Business / UI classification : UI Code
This page is also available for…
|
|
|
| |
| | https://youtu.be/Eajy0iH2HaE
https://windevdesenvolvimento.blogspot.com/2019/02/dicas-2016-windev-tabela-92-tabletoexcel.html
TableToExcel(TABLE_WIN_TABELA_EXEMPLO,"EXEMPLO.XLS",taColumnsTitles)
|
|
|
|
| |
| |
| |
|
| Exemplo Ler Tabela e Exportar Excel |
|
| s_path is string=CompleteDir(fExeDir()) // s_path=ComplèteRep(fRepExe()) // Em frances TableToExcel(TABLE_pedido,s_path+"nome_excel.xls") //TableVersExcel(TABLE_pedido,s_path+"nome_excel.xls") // em frances ShellExecute(s_path+"nome_excel.xls")
//Blog com Video e Exemplo http://windevdesenvolvimento.blogspot.com.br/2016/02/curso-windev-excel-002-ler-tabela-e.html |
|
|
|
| |
| |
| |
| |
| |
| |
| | |
| |