MESCIUS SPREAD for ASP.NET 10.0J
SaveTextFileRange(Int32,Int32,Int32,Int32,Stream,Boolean,IncludeHeaders,String,String,String,Boolean,Encoding) メソッド

行の開始インデックス
列の開始インデックス
行数
列数
セル範囲の保存先のストリーム
データを書式なしで保存するかどうかを表すブール値
どのヘッダセルのデータを保存するか
行区切り文字列
列区切り文字列
セル区切り文字列
セル区切り文字をすべてのセル値で使用する場合は True、必要に応じて使用する場合は False
エンコーディング
シート(およびヘッダ)内の範囲を区切り文字付きテキストとして指定したストリームに保存します。
構文
'Declaration
 
Public Overloads Function SaveTextFileRange( _
   ByVal row As Integer, _
   ByVal column As Integer, _
   ByVal rowCount As Integer, _
   ByVal columnCount As Integer, _
   ByVal stream As Stream, _
   ByVal unformatted As Boolean, _
   ByVal includeHeaders As IncludeHeaders, _
   ByVal rowDelimiter As String, _
   ByVal columnDelimiter As String, _
   ByVal cellDelimiter As String, _
   ByVal forceCellDelimiter As Boolean, _
   ByVal encoding As Encoding _
) As Boolean

パラメータ

row
行の開始インデックス
column
列の開始インデックス
rowCount
行数
columnCount
列数
stream
セル範囲の保存先のストリーム
unformatted
データを書式なしで保存するかどうかを表すブール値
includeHeaders
どのヘッダセルのデータを保存するか
rowDelimiter
行区切り文字列
columnDelimiter
列区切り文字列
cellDelimiter
セル区切り文字列
forceCellDelimiter
セル区切り文字をすべてのセル値で使用する場合は True、必要に応じて使用する場合は False
encoding
エンコーディング
次のサンプルコードは、SaveTextFileRangeメソッドを使用します。
FpSpread1.Sheets[0].RowCount = 6;
FpSpread1.Sheets[0].ColumnCount = 6;
FpSpread1.Sheets[0].Cells[0, 0, 5, 5].Text = "test";
FpSpread1.Sheets[0].ColumnHeader.Cells[0, 0].Text = "Custom";
FpSpread1.Sheets[0].Cells[0, 0].BackColor = System.Drawing.Color.CadetBlue;

protected void Button1_Click(object sender, EventArgs e)
{
    System.IO.Stream s;
    string fileName;
    fileName = "c:\\controls\\textfile1.txt";
    s = System.IO.File.Open(fileName, System.IO.FileMode.OpenOrCreate);
    //FpSpread1.Sheets[0].SaveTextFileRange(0, 0, 5, 5, s, true, FarPoint.Web.Spread.Model.IncludeHeaders.ColumnHeadersCustomOnly, "#", "%", "^");
    //FpSpread1.Sheets[0].SaveTextFileRange(0, 0, 5, 5, s, true, FarPoint.Web.Spread.Model.IncludeHeaders.ColumnHeadersCustomOnly, false, "#", "%", "^");
    //FpSpread1.Sheets[0].SaveTextFileRange(0, 0, 5, 5, s, true, FarPoint.Web.Spread.Model.IncludeHeaders.ColumnHeadersCustomOnly, "#", "%", "^", System.Text.Encoding.ASCII);
    //FpSpread1.Sheets[0].SaveTextFileRange(0, 0, 5, 5, s, true, FarPoint.Web.Spread.Model.IncludeHeaders.ColumnHeadersCustomOnly, false, "#", "%", "^", System.Text.Encoding.ASCII);
    //FpSpread1.Sheets[0].SaveTextFileRange(0, 0, 5, 5, s, true, FarPoint.Web.Spread.Model.IncludeHeaders.ColumnHeadersCustomOnly, "#", "%", "^", false);
    //FpSpread1.Sheets[0].SaveTextFileRange(0, 0, 5, 5, s, true, FarPoint.Web.Spread.Model.IncludeHeaders.ColumnHeadersCustomOnly, false, "#", "%", "^", false);
    //FpSpread1.Sheets[0].SaveTextFileRange(0, 0, 5, 5, s, true, FarPoint.Web.Spread.Model.IncludeHeaders.ColumnHeadersCustomOnly, "#", "%", "^", false, System.Text.Encoding.ASCII);
    //FpSpread1.Sheets[0].SaveTextFileRange(0, 0, 5, 5, s, true, FarPoint.Web.Spread.Model.IncludeHeaders.ColumnHeadersCustomOnly, false, "#", "%", "^", false, System.Text.Encoding.ASCII);
    //FpSpread1.Sheets[0].SaveTextFileRange(0, 0, 5, 5, s, true, FarPoint.Web.Spread.Model.IncludeHeaders.ColumnHeadersCustomOnly, "#", "%", "^", false, System.Text.Encoding.ASCII, false);
    FpSpread1.Sheets[0].SaveTextFileRange(0, 0, 5, 5, s, true, FarPoint.Web.Spread.Model.IncludeHeaders.ColumnHeadersCustomOnly, false, "#", "%", "^", false, System.Text.Encoding.ASCII, false);
    s.Close();
}
FpSpread1.Sheets(0).RowCount = 6
FpSpread1.Sheets(0).ColumnCount = 6
FpSpread1.Sheets(0).Cells(0, 0, 5, 5).Text = "test"
FpSpread1.Sheets(0).ColumnHeader.Cells(0, 0).Text = "Custom"
FpSpread1.Sheets(0).Cells(0, 0).BackColor = Drawing.Color.CadetBlue

Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    Dim s As System.IO.Stream
    Dim fileName As String
    fileName = "c:\controls\textfile1.txt"
    s = System.IO.File.Open(fileName, System.IO.FileMode.OpenOrCreate)
    'FpSpread1.Sheets(0).SaveTextFileRange(0, 0, 5, 5, s, True, FarPoint.Web.Spread.Model.IncludeHeaders.ColumnHeadersCustomOnly, "#", "%", "^")
    'FpSpread1.Sheets(0).SaveTextFileRange(0, 0, 5, 5, s, True, FarPoint.Web.Spread.Model.IncludeHeaders.ColumnHeadersCustomOnly, False, "#", "%", "^")
    'FpSpread1.Sheets(0).SaveTextFileRange(0, 0, 5, 5, s, True, FarPoint.Web.Spread.Model.IncludeHeaders.ColumnHeadersCustomOnly, "#", "%", "^", System.Text.Encoding.ASCII)
    'FpSpread1.Sheets(0).SaveTextFileRange(0, 0, 5, 5, s, True, FarPoint.Web.Spread.Model.IncludeHeaders.ColumnHeadersCustomOnly, False, "#", "%", "^", System.Text.Encoding.ASCII)
    'FpSpread1.Sheets(0).SaveTextFileRange(0, 0, 5, 5, s, True, FarPoint.Web.Spread.Model.IncludeHeaders.ColumnHeadersCustomOnly, "#", "%", "^", False)
    'FpSpread1.Sheets(0).SaveTextFileRange(0, 0, 5, 5, s, True, FarPoint.Web.Spread.Model.IncludeHeaders.ColumnHeadersCustomOnly, False, "#", "%", "^", False)
    'FpSpread1.Sheets(0).SaveTextFileRange(0, 0, 5, 5, s, True, FarPoint.Web.Spread.Model.IncludeHeaders.ColumnHeadersCustomOnly, "#", "%", "^", False, System.Text.Encoding.ASCII)
    'FpSpread1.Sheets(0).SaveTextFileRange(0, 0, 5, 5, s, True, FarPoint.Web.Spread.Model.IncludeHeaders.ColumnHeadersCustomOnly, False, "#", "%", "^", False, System.Text.Encoding.ASCII)
    'FpSpread1.Sheets(0).SaveTextFileRange(0, 0, 5, 5, s, True, FarPoint.Web.Spread.Model.IncludeHeaders.ColumnHeadersCustomOnly, "#", "%", "^", False, System.Text.Encoding.ASCII, False)
    FpSpread1.Sheets(0).SaveTextFileRange(0, 0, 5, 5, s, True, FarPoint.Web.Spread.Model.IncludeHeaders.ColumnHeadersCustomOnly, False, "#", "%", "^", False, System.Text.Encoding.ASCII, False)
    s.Close()
End Sub
参照

SheetView クラス
SheetView メンバ
オーバーロード一覧

 

 


© MESCIUS inc. All rights reserved.