Version

EmbeddedVisualReportSection Constructor(Visual)

Initializes a new instance of the EmbeddedVisualReportSection class.
Syntax
'Declaration
 
Public Function New( _
   ByVal sourceVisual As Visual _
)
public EmbeddedVisualReportSection( 
   Visual sourceVisual
)

Parameters

sourceVisual
The source visual to be printed
Exceptions
ExceptionDescription
System.ArgumentNullExceptionsourceVisual can not be null.
Remarks

If sourceVisual implements the Infragistics.Windows.Reporting.IEmbeddedVisualPaginatorFactory interface then the interface's Infragistics.Windows.Reporting.IEmbeddedVisualPaginatorFactory.Create method will be called to create the VisualPaginator before the PaginationStarting event is raised.

In this case the VisualPaginator will be cleared immediately after the PaginationEnded event is raised.

Note:XamDataGrid implements the Infragistics.Windows.Reporting.IEmbeddedVisualPaginatorFactory interface and returns a special derived class of DataPresenterBase as the VisualPaginator. Therefore, if special event handling is required, the events can be wired up in the PaginationStarting event by casting the VisualPaginator to DataPresenterBase. Those events can be unwired in the PaginationEnded event.

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