[]
        
(Showing Draft Content)

GrapeCity.ActiveReports.Viewer.Wpf.Viewer.Export

Export Method

Export(IDocumentExport, FileInfo)

Exports the specified page range of the currently loaded report to the specified file by using the specified export filter.

Declaration
public void Export(IDocumentExport filter, FileInfo file)
Parameters
Type Name Description
IDocumentExport filter

The export filter to use.

FileInfo file

The file to export to.

Examples

An example of export report to pdf file:

var pdfExport = new PdfExport();
var exportFile = new FileInfo("path/to/your/report.pdf");
viewer.Export(pdfExport, exportFile);

Export(IDocumentExport, FileInfo, string)

Exports the specified page range of the currently loaded report to the specified file by using the specified export filter.

Declaration
public void Export(IDocumentExport filter, FileInfo file, string pageRange)
Parameters
Type Name Description
IDocumentExport filter

The export filter to use.

FileInfo file

The file to export to.

string pageRange

The page range to export. The format of the range is a comma-separated list of page numbers "2,5,7" or page ranges "3-5". If an empty string is provided, the entire report is exported.

Examples

An example of export report to pdf file:

var pdfExport = new PdfExport();
var exportFile = new FileInfo("path/to/your/report.pdf");
viewer.Export(pdfExport, exportFile, "1,3,5");

Export(IDocumentExport, Stream)

Exports the specified page range of the currently loaded report to the specified stream by using the specified export filter.

Declaration
public void Export(IDocumentExport filter, Stream stream)
Parameters
Type Name Description
IDocumentExport filter

The export filter to use.

Stream stream

The stream to export to.

Examples

An example of export report to pdf file:

using (var stream = new MemoryStream())
{
	var pdfExport = new PdfExport();
	viewer.Export(pdfExport, stream);
	// Use the stream containing the exported report
}

Export(IDocumentExport, Stream, string)

Exports the specified page range of the currently loaded report to the specified stream by using the specified export filter.

Declaration
public void Export(IDocumentExport filter, Stream stream, string pageRange)
Parameters
Type Name Description
IDocumentExport filter

The export filter to use.

Stream stream

The stream to export to.

string pageRange

The page range to export. The format of the range is a comma-separated list of page numbers "2,5,7" or page ranges "3-5". If an empty string is provided, the entire report is exported.

Examples

An example of export report to pdf file:

using (var memoryStream = new MemoryStream())
{
	var pdfExport = new PdfExport();
	viewer.Export(pdfExport, memoryStream, "1,5");
	// The memoryStream contains the first and the fifth pages of the report exported as a PDF.
}