Version

Print(Boolean,Boolean,FrameworkElement) Method

Prints the report and can show an optional progress window (with a specified owning window) as well as a standard print dialog.
Syntax
'Declaration
 
Public Overloads Sub Print( _
   ByVal showPrintDialog As Boolean, _
   ByVal showReportProgressControl As Boolean, _
   ByVal reportProgressControlOwnedElement As FrameworkElement _
) 

Parameters

showPrintDialog
If true a standard print dialog is firat displayed to the user before printing begins.
showReportProgressControl
If true a progress window is displayed during the print operation.
reportProgressControlOwnedElement
The owning element. This element will be used to set the owner of the progress window displayed during the print operation.
Exceptions
ExceptionDescription
System.InvalidOperationExceptionThe exception will be thrown if you try to export or print a Report that doesn't have any sections.
Example
This example shows how to export report to XPS file

Private  Sub ExportReport()
   Dim reportObj As Report =  New Report() 
   Dim section As EmbeddedVisualReportSection =  New EmbeddedVisualReportSection(XamDataGrid1) 
   reportObj.Sections.Add(section)
 
   ' Call export method and put to it file to export without SaveFileDialog
   reportObj.Export(OutputFormat.XPS, "C:\\export.xps", False)
End Sub
private void ExportReport()
{
   Report reportObj = new Report();
   EmbeddedVisualReportSection section = new EmbeddedVisualReportSection(XamDataGrid1);
   reportObj.Sections.Add(section);

   // Call export method and put to it file to export without SaveFileDialog
   reportObj.Export(OutputFormat.XPS, "C:\\export.xps", 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