This example shows how to populate report with more than one section. In example XamDataGrid1 is an instance of XamDataGrid, and XamDataGrid2 is another instance of XamDataGrid
Private Sub CreateReport()
' 1. Create Report object
Dim reportObj As New Report()
' 2. Create EmbeddedVisualReportSection section.
' Put the grid you want to print as a parameter of section's constructor
Dim gridSection As New EmbeddedVisualReportSection(XamDataGrid1)
Dim anothergridSection As New EmbeddedVisualReportSection(XamDataGrid2)
' 3. Add created sections to report's section collection
reportObj.Sections.Add(gridSection)
reportObj.Sections.Add(anothergridSection)
' 4. Call print method
reportObj.Print(False, True)
End Sub
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 gridSection = new EmbeddedVisualReportSection(XamDataGrid1);
EmbeddedVisualReportSection anothergridSection = new EmbeddedVisualReportSection(XamDataGrid2);
// 3. Add created sections to report's section collection
reportObj.Sections.Add(gridSection );
reportObj.Sections.Add(anothergridSection );
// 4. Call print method
reportObj.Print(false, true);
}
Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2