FlexCel Studio for VCL/LCL
ContentsIndex
PreviousUpNext
TFlexCelImport.LoadFromTextStream Method (TStream, UTF16Char, array of XLSColumnImportTypes, TEncoding, boolean)

This method is similar to OpenText, but it reads the data from a stream instead of a file. 

NOTE: This overload of this method (using TEncoding) is only available in Delphi 2009 or newer. 

 

Pascal
procedure LoadFromTextStream(const DataStream: TStream; const Delimiter: UTF16Char; const ColumnFormats: array of XLSColumnImportTypes; const Encoding: TEncoding; const DetectBOM: boolean); overload;
C++
__fastcall LoadFromTextStream(const TStream DataStream, const UTF16Char Delimiter, const array of XLSColumnImportTypes ColumnFormats, const TEncoding Encoding, const boolean DetectBOM);
Parameters 
Description 
const DataStream: TStream 
Stream with the Excel file. Make sure it is at the correct position (normally 0), since FlexCel will try to read the file from the current position. 
const Delimiter: UTF16Char 
The character used to separate fields. 
const ColumnFormats: array of XLSColumnImportTypes 
An array of formats that you can supply so FlexCel knows which kind of data a column contains. For each column in the ColumnFormats array, you can specify:
  • xct_General: Try to convert it to a number, a date, etc.
  • xct_Text : Keep the column as text, even if it can be converted to a number or other things.
  • xct_Skip: Do not import this column.
 
const Encoding: TEncoding 
Encoding used in the file you are trying to read. For example it might be Encoding.UTF8 
const DetectBOM: boolean 
Indicates whether to look for byte order marks at the beginning of the file.
 
Copyright (c) 2002-2008 TMS Software. All rights reserved.
What do you think about this topic? Send feedback!