Version

Export(OutputFormat) Method

Exports the Report to a file in a specified output format. The Infragistics.Windows.Reporting.ReportSettings.FileName determinates the exported file name.
Syntax
'Declaration
 
Public Overloads Sub Export( _
   ByVal outputFormat As OutputFormat _
) 
public void Export( 
   OutputFormat outputFormat
)

Parameters

outputFormat
The output document type (XPS only).
Exceptions
ExceptionDescription
System.NotSupportedExceptionThe exception will be thrown if you try to run export in non FullTrust environment.
System.InvalidOperationExceptionThe exception will be thrown if you try to export or print a Report that doesn't have any sections.
Remarks

If the ReportSettings.Infragistics.Windows.Reporting.ReportSettings.FileName property is not set, then the Report will be exported in System.Environment.CurrentDirectory with default file name: Export.xps. If the Infragistics.Windows.Reporting.ReportSettings.FileName property contains only a folder name, e.g. 'C:\MyFolder\', the Report will be exported in that folder with a filename of Export.xps. If the property only contains a file name, e.g. "xamGridExport.xps", the Report will be exported in the CurrentDirectory with the specified name.

Example
This sample shows how to export report to XPS file

Private Sub ExportReport()
    Dim reportObj As New Report()
    Dim section As New EmbeddedVisualReportSection(XamDataGrid1)
    reportObj.Sections.Add(section)
    
    ' Set the file name 
    reportObj.ReportSettings.FileName = "c:\export.xps"
    
    ' Call export method
    reportObj.Export(OutputFormat.XPS)
End Sub
private void ExportReport()
{
	Report reportObj = new Report();
	EmbeddedVisualReportSection section = new EmbeddedVisualReportSection(XamDataGrid1);
	reportObj.Sections.Add(section);

   // Set the file name 
	reportObj.ReportSettings.FileName = "c:\\export.xps";

	// Call export method
	reportObj.Export(OutputFormat.XPS);
}
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