Andrea123
Technical User
- May 18, 2009
- 4
How can I send a RPT to Excel?
I was trying with the following vbs, but it doesn't work, and I prefer to do it with java script
Dim cryRpt As New ReportDocument
cryRpt.Load("F:\VB\CrystalReport1.rpt")
Try
Dim CrExportOptions As ExportOptions
Dim CrDiskFileDestinationOptions As New _ DiskFileDestinationOptions()
Dim CrFormatTypeOptions As New ExcelFormatOptions
CrDiskFileDestinationOptions.DiskFileName = "F:\VB\crystalExport.pdf"
CrExportOptions = cryRpt.ExportOptions
With
CrExportOptions .ExportDestinationType = ExportDestinationType.DiskFile .ExportFormatType = ExportFormatType.Excel .DestinationOptions = CrDiskFileDestinationOptions .FormatOptions = CrFormatTypeOptions
End With
cryRpt.Export()
Catch ex As Exception
MsgBox(ex.ToString)
End Try
I was trying with the following vbs, but it doesn't work, and I prefer to do it with java script
Dim cryRpt As New ReportDocument
cryRpt.Load("F:\VB\CrystalReport1.rpt")
Try
Dim CrExportOptions As ExportOptions
Dim CrDiskFileDestinationOptions As New _ DiskFileDestinationOptions()
Dim CrFormatTypeOptions As New ExcelFormatOptions
CrDiskFileDestinationOptions.DiskFileName = "F:\VB\crystalExport.pdf"
CrExportOptions = cryRpt.ExportOptions
With
CrExportOptions .ExportDestinationType = ExportDestinationType.DiskFile .ExportFormatType = ExportFormatType.Excel .DestinationOptions = CrDiskFileDestinationOptions .FormatOptions = CrFormatTypeOptions
End With
cryRpt.Export()
Catch ex As Exception
MsgBox(ex.ToString)
End Try