Partager via


ReportDocument.Export Méthode

Exporte un rapport dans un format et vers une destination spécifiés dans l'objet ExportOptions.

[Visual Basic]

Public Overrideable Sub Export( _
   ByVal options As CrystalDecisions.Shared.ExportOptions _
)

[C#]

public virtual void Export(
   CrystalDecisions.Shared.ExportOptions options
);

Paramètres

  • options
    Le type de format et la destination d'exportation du rapport.

Exemple

[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);
            }
            
[Visual Basic]

            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
            
[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);
            }; 
            
[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);
            }
            

Configuration requise

Espace de noms CrystalDecisions.CrystalReports.Engine

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

Voir aussi

ReportDocument Classe | ReportDocument Membres | CrystalDecisions.CrystalReports.Engine Espace de noms

**

©2005 Business Objects SA. Tous droits réservés.

Business Objects SA.
http://www.france.businessobjects.com/
Services de support
http://www.businessobjects.com/support/