XlsFile.Export Method
Overloads
- XlsFile.Export(TextWriter, TXlsCellRange, Char, Boolean, String)
- XlsFile.Export(TextWriter, TXlsCellRange, Int32, Int32[], Boolean, Boolean, String)
XlsFile.Export(TextWriter, TXlsCellRange, Char, Boolean, String)
Exports a range of cells from the active sheet into a text file (character delimited columns).
Syntax
Namespace: FlexCel.XlsAdapter
public override void Export(TextWriter aTextWriter, TXlsCellRange range, Char delimiter, Boolean exportHiddenRowsOrColumns, String newLine)
Parameters
<-> | Parameter | Type | Description |
---|---|---|---|
aTextWriter | TextWriter | TextWriter where we want to save the file. | |
range | TXlsCellRange | Range of cells to export. If you want to export the full sheet, set it to null. | |
delimiter | Char | Character used to delimit the fields in the exported file. You might normally use a comma (',') or a tab here. | |
exportHiddenRowsOrColumns | Boolean | If true, hidden rows and columns will be exported. If false, they will be ignored. | |
newLine | String | String used to separate lines. If not specified, this will be the string used in the OS. |
See also
XlsFile.Export(TextWriter, TXlsCellRange, Int32, Int32[], Boolean, Boolean, String)
Exports a range of cells from the active sheet into a text file (fixed length columns).
Syntax
Namespace: FlexCel.XlsAdapter
public override void Export(TextWriter aTextWriter, TXlsCellRange range, Int32 charactersForFirstColumn, Int32[] columnWidths, Boolean exportHiddenRowsOrColumns, Boolean exportTextOutsideCells, String newLine)
Parameters
<-> | Parameter | Type | Description |
---|---|---|---|
aTextWriter | TextWriter | TextWriter where we want to save the file. | |
range | TXlsCellRange | Range of cells to export. If you want to export the full sheet, set it to null. | |
charactersForFirstColumn | Int32 | This value only has effect if columnWidths is null. It will specify how many characters to use for the first column, and all other columns will be determined according to their ratio with the first. For example, if the first column is 150 pixels wide and you specify "8" for this parameter, the first column will be padded to 8 characters when exporting. If the second column is 300 pixels wide, then it will be padded to 16 characters and so on. As this might not be 100% exact and depend in pixel measurements, you might want to specify columnWidths parameter instead of using this one. Note: Setting this parameter to a negative value will assume the text in the columns is already padded, and won't attempt to do any padding. Use this value if your data is padded in the spreadsheet itself. |
|
columnWidths | Int32[] | Array with the number of characters that will be assigned to every column when exporting. Supplying this array allows you to specify exactly how many characters you want for every field, and that might be really necessary to interop with other applications. But you can also leave this parameter null and specify "charactersForFirstColumn" to let FlexCel calculate how many characters to apply for every field. |
|
exportHiddenRowsOrColumns | Boolean | If true, hidden rows and columns will be exported. If false, they will be ignored. | |
exportTextOutsideCells | Boolean | If true and the cell text spans over more than one empty cell to the right, that text will be exported. When false (the default) only text that fits in the cell will be exported. When this value is true the printout will look better, but it will not be possible to reimport the data as the columns are lost. |
|
newLine | String | String used to separate lines in the output. If omitted, we will use the OS new line separator. |