CellTag 機能を使用するには?

文書番号 : 17447     文書種別 : 使用方法     最終更新日 : 2005/05/12
文書を印刷する
対象製品
El Tabelle for .NET 3.0J
詳細
DenpyoMan における CellTag プロパティや TagMatrix プロパティのように、セルに負荷データを設定するには、多次元配列を使用して独自に付加情報を管理します。

WorkBook/Sheet の場合、次のようにコーディングします。

[Visual Basic]
Dim sTagMatrix(,) As String

Dim iColumnCount As Integer = Sheet1.MaxColumns - 1
Dim iRowCount As Integer = Sheet1.MaxRows - 1

'CellTag用の配列を初期化する
ReDim sTagMatrix(iColumnCount, iRowCount)

Me.Sheet1(0, 0).Text = "CellText"
sTagMatrix(0, 0) = "CellTag"
Me.Sheet1(1, 1).Text = "テスト"
sTagMatrix(1, 1) = "てすと"

'CellTagの値を出力する
Console.WriteLine(sTagMatrix(0, 0))
Console.WriteLine(sTagMatrix(1, 1))
[C#]
string[,] sTagMatrix;

int iColumnCount = this.sheet1.MaxColumns - 1;
int iRowCount = this.sheet1.MaxRows - 1;

//CellTag用の配列を初期化する
sTagMatrix = new string[iColumnCount, iRowCount];

this.sheet1[0, 0].Text = "CellText";
sTagMatrix[0, 0] = "CellTag";

this.sheet1[1, 1].Text = "テスト";
sTagMatrix[1, 1] = "てすと";

//CellTagの値を出力する
Console.WriteLine(sTagMatrix[0, 0]);
Console.WriteLine(sTagMatrix[1, 1]);

MultiRowSheet の場合、次のようにコーディングします。

[Visual Basic]
Dim sTagMatrix(,,) As String

'マルチ行の行数
Dim iMaxMRows As Integer = Me.MultiRowSheet1.MaxMRows - 1
'テンプレートのセル数
Dim iColumnCount As Integer = 4
Dim iRowCount As Integer = 2

'CellTag用の配列を初期化する
ReDim sTagMatrix(iMaxMRows, iColumnCount, iRowCount)

Me.MultiRowSheet1(0, 0, 0).Text = "CellText"
sTagMatrix(0, 0, 0) = "CellTag"
Me.MultiRowSheet1(1, 1, 1).Text = "テスト"
sTagMatrix(1, 1, 1) = "てすと"

'CellTagの値を出力する
Console.WriteLine(sTagMatrix(0, 0, 0))
Console.WriteLine(sTagMatrix(1, 1, 1))
[C#]
string[,,] sTagMatrix;

//マルチ行の行数
int iMaxMRows = this.multiRowSheet1.MaxMRows;
//テンプレートのセル数
int iColumnCount = 4;
int iRowCount = 2;

//CellTag用の配列を初期化する
sTagMatrix = new string[iMaxMRows, iColumnCount, iRowCount];

this.multiRowSheet1[0, 0, 0].Text = "CellText";
sTagMatrix[0, 0, 0] = "CellTag";

this.multiRowSheet1[1, 1, 1].Text = "テスト";
sTagMatrix[1, 1, 1] = "てすと";

//CellTagの値を出力する
Console.WriteLine(sTagMatrix[0, 0, 0]);
Console.WriteLine(sTagMatrix[1, 1, 1]);

この文書は、以前は次のFAQ IDで公開されていました : 6998