Hello,
I am using crystal reports 9 with VB 6 .0 . I want to export the report on a form load. For this purpose I have designed a report in crystal designer. Then I have used the flowing code to generate the file. It creates the world file but file does not contains any data. But if I preview of the report then it shows me the data. I have tried a lot. Please some one tells me why this is happening. Thanks in advance fazi
Dim Report As New CrystalReport1
Dim crApp As New CRAXDDRT.Application
Dim crRep As New CRAXDDRT.Report
Private Sub Form_Load()
'Export to disk
' Location of the report
Set crRep = crApp.OpenReport(App.Path & "/Reports/Myreport.rpt"
Report.ExportOptions.DestinationType = crEDTDiskFile
'Export to Microsoft Word format
Report.ExportOptions.FormatType = crEFTWordForWindows
'Export path and file name
Report.ExportOptions.DiskFileName = "c:\MyReport.doc"
'Export without displaying the 'Export' dialog box
Report.Export False
End Sub
I am using crystal reports 9 with VB 6 .0 . I want to export the report on a form load. For this purpose I have designed a report in crystal designer. Then I have used the flowing code to generate the file. It creates the world file but file does not contains any data. But if I preview of the report then it shows me the data. I have tried a lot. Please some one tells me why this is happening. Thanks in advance fazi
Dim Report As New CrystalReport1
Dim crApp As New CRAXDDRT.Application
Dim crRep As New CRAXDDRT.Report
Private Sub Form_Load()
'Export to disk
' Location of the report
Set crRep = crApp.OpenReport(App.Path & "/Reports/Myreport.rpt"
Report.ExportOptions.DestinationType = crEDTDiskFile
'Export to Microsoft Word format
Report.ExportOptions.FormatType = crEFTWordForWindows
'Export path and file name
Report.ExportOptions.DiskFileName = "c:\MyReport.doc"
'Export without displaying the 'Export' dialog box
Report.Export False
End Sub