Export (0) Print
Expand All

ReportDocument.Export Method

Visual Studio 2005

Exports a report to a format and destination specified within the ExportOptions Object.

[Visual Basic]
        Public Overrideable Sub Export( _
        
   ByVal  options As CrystalDecisions.Shared.ExportOptions _
)
[C#]
        public virtual void Export(
   CrystalDecisions.Shared.ExportOptions options 
);

Parameters

options

The format and destination to export the report.

Example

Tutorial

The following example exports a report to disk as a RTF document.

      [C#]
            private void ExportToDisk (string fileName)
            {
               ExportOptions exportOpts = new ExportOptions();
               DiskFileDestinationOptions diskOpts =
                  ExportOptions.CreateDiskFileDestinationOptions();
            
               exportOpts.ExportFormatType = ExportFormatType.RichText;
               exportOpts.ExportDestinationType =
                  ExportDestinationType.DiskFile;
            
               diskOpts.DiskFileName = fileName;
               exportOpts.ExportDestinationOptions = diskOpts;
            
               Report.Export(exportOpts);
            }
            
      [C++]
            void ExportToDisk(String* fileName)
            {
               ExportOptions* exportOpts =
                  new ExportOptions();
               DiskFileDestinationOptions* diskOpts = 
                  ExportOptions.CreateDiskFileDestinationOptions();
            
               exportOpts->ExportFormatType = ExportFormatType::RichText;
               exportOpts->ExportDestinationType = 
               ExportDestinationType::DiskFile;
            
               diskOpts->DiskFileName = fileName;
               exportOpts->ExportDestinationOptions = diskOpts;
            
               Report->Export(exportOpts);
            }; 
            
      [VB]
            Private Sub ExportToDisk(ByVal fileName As String)
               Dim exportOpts As New ExportOptions()
               Dim diskOpts As DiskFileDestinationOptions
               diskOpts = ExportOptions.CreateDiskFileDestinationOptions()
            
               exportOpts.ExportFormatType = _
                  ExportFormatType.RichText
               exportOpts.ExportDestinationType = _
                  ExportDestinationType.DiskFile
            
               diskOpts.DiskFileName = fileName
               exportOpts.ExportDestinationOptions = diskOpts
            
               Report.Export(exportOpts)
            End Sub
            
      [VJ#]
            private void exportToDisk(String fileName)
            {
               ExportOptions exportOpts = new ExportOptions();
               DiskFileDestinationOptions diskOpts =
                  ExportOptions.CreateDiskFileDestinationOptions();
            
               exportOpts.set_ExportFormatType(ExportFormatType.RichText);
               exportOpts.set_ExportDestinationType(ExportDestinationType.DiskFile);
            
               diskOpts.set_DiskFileName(fileName);
               exportOpts.set_ExportDestinationOptions(diskOpts);
            
               Report.Export(exportOpts);
            }
            

Requirements

Namespace   CrystalDecisions.CrystalReports.Engine

Assembly  CrystalDecisions.CrystalReports.Engine (CrystalDecisions.CrystalReports.Engine.dll)

See Also

ReportDocument Class | ReportDocument Members | CrystalDecisions.CrystalReports.Engine Namespace

Show:
© 2014 Microsoft