Version

EmbeddedVisualReportSection Constructor(Visual,IEmbeddedVisualPaginator)

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

Parameters

sourceVisual
The source visual to be printed
visualPaginator
Object that implements the IEmbeddedVisualPaginator interface to provide pagination.
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
While XamDataGrid implements IEmbeddedVisualPaginatorFactory interface you can use constructor by the following way:

Private Sub SetReportSettings()
    Dim reportObj As New Report()
    
    Dim factory As IEmbeddedVisualPaginatorFactory = TryCast(XamDataGrid1, IEmbeddedVisualPaginatorFactory)
    Dim visualPaginator As IEmbeddedVisualPaginator = factory.Create()
      
    Dim section As New EmbeddedVisualReportSection(XamDataGrid1, visualPaginator)
    reportObj.Sections.Add(section)
    
    reportObj.Print(False)
End Sub
private void SetReportSettings()
{
	Report reportObj = new Report();

	IEmbeddedVisualPaginatorFactory factory = XamDataGrid1 as IEmbeddedVisualPaginatorFactory;
	IEmbeddedVisualPaginator visualPaginator = factory.Create();
		
	EmbeddedVisualReportSection section = new EmbeddedVisualReportSection(XamDataGrid1, visualPaginator);
	reportObj.Sections.Add(section);
	reportObj.Print(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