'Declaration Public Overloads Sub Export( _ ByVal outputFormat As OutputFormat, _ ByVal stream As Stream _ )
public void Export( OutputFormat outputFormat, Stream stream )
Exception | Description |
---|---|
System.NotSupportedException | The exception will be thrown if you try to run export in a non FullTrust environment. |
System.InvalidOperationException | The exception will be thrown if you try to export or print a Report that doesn't have any sections. |
If you stream is null then the result will be the same as calling Export(OutputFormat).
Private Sub ExportReport() Dim reportObj As New Report() Dim section As New EmbeddedVisualReportSection(XamDataGrid1) reportObj.Sections.Add(section) ' Create stream and call export method Using fs As New FileStream("C:\export.xps", FileMode.Create) reportObj.Export(OutputFormat.XPS, fs) End Using End Sub
private void ExportReport() { Report reportObj = new Report(); EmbeddedVisualReportSection section = new EmbeddedVisualReportSection(XamDataGrid1); reportObj.Sections.Add(section); // Create stream and call export method using (FileStream fs = new FileStream("C:\\export.xps", FileMode.Create)) { reportObj.Export(OutputFormat.XPS, fs); } }
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