How to Export a crystal report 8.5 file to msword or excel etc in vb6.0?
Hi all,
I already designed reports which are working fine. I need to export it to word or excel or something else.
Please help me. I am using Crystal reports 8.5 and VB 6
Thanks in advance.
Re: How to Export a crystal report 8.5 file to msword or excel etc in vb6.0?
You want to export an existing report after it's created? Or you want to create a "report" as a Word document?
Re: How to Export a crystal report 8.5 file to msword or excel etc in vb6.0?
I want to export an existing report after it's created.
Re: How to Export a crystal report 8.5 file to msword or excel etc in vb6.0?
Where is it being created? To a disk file? To the printer? To memory?
Re: How to Export a crystal report 8.5 file to msword or excel etc in vb6.0?
Re: How to Export a crystal report 8.5 file to msword or excel etc in vb6.0?
Should be something like this...
VB Code:
Option Explicit
'Add a reference to CR xx.x ActiveX Designer Runtim Library
Private Sub Command1_Click()
Dim crApp As CRAXDRT.Application
Dim oRpt As CRAXDRT.Report
Set crApp = New CRAXDRT.Application
Set oRpt = crApp.OpenReport("D:\Report1.rpt", 1)
oRpt.ExportOptions.DestinationType = crEDTDiskFile
oRpt.ExportOptions.DiskFileName = "D:\Report1.xls"
oRpt.ExportOptions.FormatType = crEFTExcel80
oRpt.ExportOptions.ExcelUseConstantColumnWidth = True
oRpt.Export False
End Sub