I need help exporting a crystal report to a word document from VB6. (The Stored Proc works and the report appears properly) I just need an example of code in VB that shows me how to export the report to a file instead of a printer.
Use the .exportoptions command to set the destination type, the format of the file and the name of the file. THen use .export to export the file. For example, the code below says for report1 I'm going to spool a file to the disk of format type Excel named "Test.xls". Now export it and don't prompt the user. It then does it again in rich text format.
With Report1
.ExportOptions.DestinationType = crEDTDiskFile
.ExportOptions.FormatType = crEFTExcel80
.ExportOptions.DiskFileName = "C:/Test.xls"
.Export (False)
.ExportOptions.DestinationType = crEDTDiskFile
.ExportOptions.FormatType = crEFTRichText
.ExportOptions.DiskFileName = "C:/Test.doc"
.Export (False)
End With
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.