Report 要素は、レポート全体を定義する最上位オブジェクトです。すべてのコンテンツは、Section 要素を介してレポートに追加する必要があります。ほとんどのレイアウト 要素は追加のネストされたレイアウト 要素を作成するためのメソッドを使用します。これは、Report 要素でも同じですが、Report 要素に追加できる唯一のレイアウト 要素 タイプは Section 要素です。この概念をオブジェクト モデル図のように視覚化するとより分かりやすくなります。たとえば、レポートのレイアウトが以下のツリーと同じ位シンプルな場合があります。
上記のツリーから、Section が Report 要素に追加可能な唯一のレイアウト 要素であることが分かります。Section 要素は別の Section 要素に加えて任意のコンテンツ 要素を含むことができます。論理的に、Report 要素に追加できるのが Section 要素のみの場合には、すべてを Section 要素に追加可能であることが必要となります。
Report 要素にもレポートの記述に重要ないくつかのその他のプロパティとメソッドがあります。以下は頻繁に使用する可能性が高いレポート機能の簡潔なリストです。
以下のコードは、上記のツリーと同じ構造でレポートを作成します。この例はその他のプロパティを設定せずに、オブジェクトをインスタンス化するだけです。詳細を示す例のコードについては、個々の要素のヘルプ トピックを参照してください。
C# の場合:
using Infragistics.Documents.Reports.Report;
using Infragistics.Documents.Reports.Report.Section;
using Infragistics.Documents.Reports.Report.TOC;
using Infragistics.Documents.Reports.Report.Index;
using Infragistics.Documents.Reports.Report.Band;
using Infragistics.Documents.Reports.Report.Flow;
using Infragistics.Documents.Reports.Report.Table;
.
.
.
Report report = new Report();
ISection section1 = report.AddSection();
IGroup group1 = section1.AddGroup();
ISection section2 = report.AddSection();
ITOC tableOfContents = section2.AddTOC();
ISection section3 = report.AddSection();
IReportBand band1 = section3.AddBand();
IFlow flow1 = band1.AddFlow();
ISection section4 = report.AddSection();
ITable table1 = section4.AddTable();
ISection section5 = report.AddSection();
IIndex index1 = section5.AddIndex();
オンラインで表示: GitHub