使用保存对话框从Crystal Reports导出PDF或Excel文件

时间:2014-11-11 23:50:55

标签: vb.net crystal-reports crystal-reports-2008

我目前正在使用此代码,如何使用保存对话框来实现此代码。 我也试过这个:Dim path As String = IO.Path.GetDirectoryName(SaveFileDialog.FileName)

Try
   Dim CrExportOptions As CrystalDecisions.Shared.ExportOptions
   Dim CrDiskFileDestinationOptions As New  _
   CrystalDecisions.Shared.DiskFileDestinationOptions()
   Dim CrFormatTypeOptions As New CrystalDecisions.Shared.PdfRtfWordFormatOptions()
   CrDiskFileDestinationOptions.DiskFileName = "c:/crystalExport.pdf"
   CrExportOptions = crypt.ExportOptions
      With CrExportOptions
          .ExportDestinationType = CrystalDecisions.Shared.ExportDestinationType.DiskFile
          .ExportFormatType = CrystalDecisions.Shared.ExportFormatType.PortableDocFormat
          .DestinationOptions = CrDiskFileDestinationOptions
          .FormatOptions = CrFormatTypeOptions
      End With
      crypt.Export()
  Catch ex As Exception
  End Try

0 个答案:

没有答案