バージョン

クイック表

表には当然のことながらいくつかの要素が含まれるため、Quick Table 要素は軽量の Quick Content 要素の中で最も重い要素となっています。以下の要素を Quick Table 要素に追加できます。

  • セル
  • ヘッダー
  • 区分線
  • フッター

Quick Table 要素の外観を変更するいくつかのプロパティを設定することも可能です。

  • 背景
  • 境界線
  • パッディング
  • 余白

Quick Table 要素は完全な Table 要素のいくつかの機能を使用します。詳細は、を参照してください。Columns、Rows、Cells はすべて繰り返し可能なコンテンツです。つまり、必要なだけこれらの要素を追加できます。ただし、Header、Divider、および Footer 要素は繰り返すことはできません。ページあたりに使用可能な Header、Divider、および Footer はひとつだけです。Header 要素と Footer 要素は繰り返し可能ではありませんが、セルは繰り返し可能です。これらの 2 つの要素はそれぞれ、追加のセルを Header 要素または Footer 要素に追加するために使用される AddCell メソッドを含んでいます。ほとんど同じようにセルを Row 要素に追加することもできます。したがって、(Header、Row、または Footer のいずれにあろうとも)セルで一杯の表を作成することはセルあたりひとつのメソッドを呼び出すのと同じように簡単です。


以下のコードは、シンプルな 3 x 3 の表を作成し、ヘッダーとフッターを追加します。表の背景色を LightSteelBlue に、枠の色を Black に設定します。このトピックは、Report 要素が定義済みで、この要素に少なくともひとつの Section 要素が追加されていることを前提としています。詳細は、Report およびSection を参照してください。

C# の場合:

section1.AddQuickText("Quick Table");
// Add a quick table
Infragistics.Documents.Reports.Report.QuickTable.IQuickTable quickTable =   section1.AddQuickTable();
// Add black borders to the outside of the table
quickTable.Borders = new Borders(new Pen(new Color(0, 0, 0)));
// Add a lightsteelblue background to the entire table
quickTable.Background = new Background(Brushes.LightSteelBlue);

// Add three columns
quickTable.AddColumn(100);
quickTable.AddColumn(100);
quickTable.AddColumn(100);

// Add Header cells
Infragistics.Documents.Reports.Report.QuickTable.IQuickTableHeader quickTableHeader =   quickTable.Header;
quickTableHeader.AddCell("Header 1");
quickTableHeader.AddCell("Header 2");
quickTableHeader.AddCell("Header 3");

// Add three rows with three cells each
Infragistics.Documents.Reports.Report.QuickTable.IQuickTableRow quickRow =   quickTable.AddRow();
quickRow.AddCell("Cell 1");
quickRow.AddCell("Cell 2");
quickRow.AddCell("Cell 3");

quickRow = quickTable.AddRow();
quickRow.AddCell("Cell 4");
quickRow.AddCell("Cell 5");
quickRow.AddCell("Cell 6");

quickRow = quickTable.AddRow();
quickRow.AddCell("Cell 7");
quickRow.AddCell("Cell 8");
quickRow.AddCell("Cell 9");

// Add Footer cells
Infragistics.Documents.Reports.Report.QuickTable.IQuickTableFooter quickTableFooter =   quickTable.Footer;
quickTableFooter.AddCell("Footer 1");
quickTableFooter.AddCell("Footer 2");
quickTableFooter.AddCell("Footer 3");

オンラインで表示: GitHub