Imports Infragistics.Windows.DataPresenter
...
Dim reportView1 As New TabularReportView() With { .ExcludeExpandedState = True}
Me.xamDataGrid1.ReportView = reportView1
'TODO: xamDataGrid コントロールの使用でレポートを作成し、印刷する。
...
Report オブジェクトの Print または Export メソッドを呼び出すと、WPF Reporting エンジンは DataPresenter コントロールの状態を正確にそのまま印刷/エクスポートします。プリントアウトまたはエクスポートされたファイルは、印刷またはエクスポート前にエンドユーザーが DataPresenter コントロールをどのように操作するのかに基づいています。たとえば、階層的な xamDataGrid™ がある場合、エンドユーザーが印刷前にランタイムに子レコードを展開しない場合は、WPF Reporting エンジンはその子レコードを印刷しません。ただし、WPF Reporting エンジンが DataPresenter コントロールを印刷/エクスポートする際に全てのレコードが展開するように、この動作を変更することができます。
階層データ モデル内の全てのレコードを印刷するには、4 ステップのプロセスを実行します。
TabularReportView オブジェクトをインスタンス化します。
TabularReportView オブジェクトの ExcludeExpandedState プロパティを True に設定します。
DataPresenter の ReportView プロパティを TabularReportView オブジェクトのインスタンスに設定します。
DataPresenter コントロールを使用してレポートを作成し印刷します。
以下のコード例は、階層内の全てのレコードの印刷方法を示しています。コード例は、xamDataGrid コントロールの ReportView プロパティを設定します。ただし、xamDataGrid コントロールを xamDataPresenter™ コントロールまたは xamDataCarousel™ コントロールに置き換えることができます。
Visual Basic の場合:
Imports Infragistics.Windows.DataPresenter
...
Dim reportView1 As New TabularReportView() With { .ExcludeExpandedState = True}
Me.xamDataGrid1.ReportView = reportView1
'TODO: xamDataGrid コントロールの使用でレポートを作成し、印刷する。
...
C# の場合:
using Infragistics.Windows.DataPresenter;
...
TabularReportView reportView1 = new TabularReportView()
{
ExcludeExpandedState = true
};
this.xamDataGrid1.ReportView = reportView1;
//TODO: xamDataGrid コントロールの使用でレポートを作成し、印刷する。
...