Spread ASP.NET 6.0 Product Documentation
SaveTextFile(Stream,Boolean) Method
See Also  Example Send Feedback
FarPoint.Web.Spread Assembly > FarPoint.Web.Spread Namespace > SheetView Class > SaveTextFile Method : SaveTextFile(Stream,Boolean) Method


stream
Stream to which to save the sheet
unformatted
Whether to save the data unformatted

Glossary Item Box

Saves the sheet as delimited text to a stream as specified.

Syntax

Visual Basic (Declaration) 
Public Overloads Function SaveTextFile( _
   ByVal stream As Stream, _
   ByVal unformatted As Boolean _
) As Boolean
Visual Basic (Usage)Copy Code
Dim instance As SheetView
Dim stream As Stream
Dim unformatted As Boolean
Dim value As Boolean
 
value = instance.SaveTextFile(stream, unformatted)
C# 
public bool SaveTextFile( 
   Stream stream,
   bool unformatted
)

Parameters

stream
Stream to which to save the sheet
unformatted
Whether to save the data unformatted

Return Value

Boolean: true if successful; false otherwise

Remarks

Set the unformatted parameter to true to bypass the IFormatter in the StyleInfo for the cell and save the data as unformatted data or false to save it as formatted.

Example

This example saves the sheet to a text file.
C#Copy Code
private void Button1Click(object sender, System.EventArgs e)
{
FarPoint.Web.Spread.SheetView sv;
System.IO.Stream s;
string fileName;
sv = FpSpread1.ActiveSheetView;
fileName = "D:\\mine.txt";
s = System.IO.File.Open(fileName, System.IO.FileMode.OpenOrCreate);
sv.SaveTextFile(s, true);
s.Close();
}
Visual BasicCopy Code
Private Sub Button1Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim sv As FarPoint.Web.Spread.SheetView
Dim s As System.IO.Stream
Dim fileName As String
sv = FpSpread1.ActiveSheetView
fileName = "D:\mine.txt"
s = System.IO.File.Open(fileName, System.IO.FileMode.OpenOrCreate)
sv.SaveTextFile(s, True)
s.Close()
End Sub

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2002-2012 GrapeCity, Inc. All Rights Reserved.