レポートを作成するには、以下を実行できます:
注: 各ページの ReportPagePresenter のスタイル、テンプレート、ヘッダー内容、およびフッター内容は以下のプロパティを設定してプロジェクト全体で指定できます:
Imports Infragistics.Windows.Reporting Private Sub CreateReport() ' 1. Create Report object Dim reportObj As Report = New Report() ' 2. Create EmbeddedVisualReportSection section. ' Put the grid you want to print as a parameter of section's constructor Dim section As EmbeddedVisualReportSection = New EmbeddedVisualReportSection(XamDataGrid1) ' 3. Add created section to report's section collection reportObj.Sections.Add(section) ' Optional. If you have progress indicator set its Report property to created report progressInfo.Report = reportObj ' 4. Call print method reportObj.Print(True, False) End Sub
using Infragistics.Windows.Reporting; private void CreateReport() { // 1. Create Report object Report reportObj = new Report(); // 2. Create EmbeddedVisualReportSection section. // Put the grid you want to print as a parameter of section's constructor EmbeddedVisualReportSection section = new EmbeddedVisualReportSection(XamDataGrid1); // 3. Add created section to report's section collection reportObj.Sections.Add(section); // Optional. If you have progress indicator set its Report property to created report progressInfo.Report = reportObj; // 4. Call print method reportObj.Print(true, false); }