Version

EmbeddedVisualReportSection Class

Class that represents a section of a Report where each page's content is supplied by an embedded visual.
Syntax
'Declaration
 
Public Class EmbeddedVisualReportSection 
   Inherits ReportSection
public class EmbeddedVisualReportSection : ReportSection 
Remarks

An instance of this class can be added to a Report's Report.Sections collection. Then, when a pagination process is started, by calling Report.Export or Report.Print on Report, the EmbeddedVisualReportSection class creates an instance of a ReportPagePresenter and sets its content based on the parameters passed into one of its constructors. It then rasies the PaginationStarting, PaginationStarted and finally the PaginationEnded events.

The EmbeddedVisualReportSection class can contain three types of objects, supplied in the constructor:

The first and second type of objects ultimately provide pagination support through the Infragistics.Windows.Reporting.IEmbeddedVisualPaginator interface. The third type of object will be printed in one page and if they don’t fit on page, they will be clipped by default. To prevent clipping of the visual set Infragistics.Windows.Reporting.ReportSettings.HorizontalPaginationMode on Infragistics.Windows.Reporting.ReportBase.ReportSettings to 'Scale'.

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.

Example
This sample shows how to create report, set its content and print it. In the sample XamDataGrid1 is an instance of XamDataGrid.

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);
}
Requirements

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

See Also