'Declaration Public ReadOnly Property Sections As ReportSectionCollection
public ReportSectionCollection Sections {get;}
Note: each section in a Report starts on a new page. For example, if you created a Report with 3 EmbeddedVisualReportSections, one with a XamDataGrid and 2 others with simple visual elements, each section would start on a new page even though there might have been available space on the last page from the previous section.
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