[]
        
(Showing Draft Content)

GrapeCity.ActiveReports.Viewer.Win.Viewer.Export

Export Method

Export(IDocumentExport, FileInfo)

Exports the currently loaded report to the specified file using the given export filter.

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

An object that implements IDocumentExport interface, providing export functionality.

FileInfo file

The FileInfo object representing the file to which the report will be exported. The file extension should match the format specified by the filter.

Remarks

This method exports the entire report. The export process is determined by the capabilities of the specified filter, which includes handling various export formats and their respective options.

Examples
// Assuming 'viewer' is your Viewer control instance
var pdfExport = new PdfExport();
var exportFilePath = new FileInfo("path/to/your/exportedFile.pdf");
viewer.Export(pdfExport, exportFilePath);
See Also

Export(IDocumentExport, FileInfo, string)

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

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

An object that implements IDocumentExport interface, providing export functionality.

FileInfo file

The FileInfo object representing the file to which the report will be exported.

string pageRange

A string specifying the range of pages to be exported. The format of the range is a comma-separated list of page numbers or page ranges. If an empty string is provided, the entire report is exported.

Remarks

This method allows for selective export of pages, which can be useful when dealing with large reports or when only a specific section of a report is needed in the exported document.

Examples

Here is an example of using an export current report to pdf file:

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

Export(IDocumentExport, Stream)

Exports the currently loaded report to the specified stream using the given export filter.

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

An object that implements IDocumentExport interface, providing export functionality.

Stream stream

The Stream to which the report will be exported. The stream must be writable.

Remarks

This method exports the entire report unless a specific page range is set in subsequent calls or configurations. The export process is determined by the capabilities of the specified filter, which includes handling various export formats and their respective options.

Examples

Here is 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 using the given export filter.

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

An object that implements IDocumentExport interface, providing export functionality.

Stream stream

The Stream to which the report will be exported. The stream must be writable.

string pageRange

A string specifying the range of pages to be exported. The format of the range is a comma-separated list of page numbers or page ranges. If an empty string is provided, the entire report is exported.

Examples

Here is an example of export report to pdf file:

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