"writeToFile"
Writes the content of a table to a file. This function can also be used to export an ODS file.
Synopsis
setValue(string shape, "writeToFile", string filename, int options, char separator
| string format);
shape.writeToFile(string filename, int options, char separator | string
format);
Parameters
Parameter | Description |
---|---|
shape | Name of the object |
filename | Path to the file to be written to. |
options |
The parameter allows you to specify which content should be included within the output. The following options are available and can also be combined using a disjunction
(
These options can be combined using a disjunction (OR). |
separator | Allows to define the separator that is used between columns. |
format | The file-format (.ods) |
Description
-
Exporting an ODS file
The table can also export an ODS file. To do this, the format sting "ods" has to be passed as the format parameter. If the given file name does not end in ".ods", the extention is appended.
Writes all (including "invisible") columns to the file " C:/test.txt". A space is used as separator.
main()
{
shape table = getShape("table123");
table.writeToFile("c:/test.txt", TABLE_WRITE_ALL_COLUMNS, " ");
}
Writes all (including "invisible") columns including the column header to the file " C:/test.txt". A space is used as separator.
main()
{
shape table = getShape("table123");
table.writeToFile("c:/test.txt", TABLE_WRITE_ALL_COLUMNS |
TABLE_WRITE_COLUMN_HEADER , " ");
}
Assignment
Table